diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-12 22:45:30 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-12 22:45:30 +0100 |
commit | 1d1c256eea43a3d0685919ed2997e10990ef639f (patch) | |
tree | 99f85ea9d8852ba3e33a05df699f028f29d3f9d1 /src/crepe/api | |
parent | 23196be83778973d9688cc5d465e4e4a16476568 (diff) |
`make format`
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/Engine.cpp | 7 | ||||
-rw-r--r-- | src/crepe/api/Engine.h | 5 | ||||
-rw-r--r-- | src/crepe/api/GameObject.cpp | 11 | ||||
-rw-r--r-- | src/crepe/api/GameObject.h | 5 | ||||
-rw-r--r-- | src/crepe/api/ParticleEmitter.cpp | 1 | ||||
-rw-r--r-- | src/crepe/api/Script.cpp | 1 | ||||
-rw-r--r-- | src/crepe/api/Script.h | 10 | ||||
-rw-r--r-- | src/crepe/api/Script.hpp | 3 | ||||
-rw-r--r-- | src/crepe/api/Transform.cpp | 1 |
9 files changed, 22 insertions, 22 deletions
diff --git a/src/crepe/api/Engine.cpp b/src/crepe/api/Engine.cpp index e8b7fd6..bbb4494 100644 --- a/src/crepe/api/Engine.cpp +++ b/src/crepe/api/Engine.cpp @@ -46,7 +46,8 @@ void Engine::loop() { try { systems.fixed_update(); } catch (const exception & e) { - Log::logf(Log::Level::WARNING, "Uncaught exception in fixed update function: {}\n", e.what()); + Log::logf(Log::Level::WARNING, + "Uncaught exception in fixed update function: {}\n", e.what()); } timer.advance_fixed_elapsed_time(); } @@ -54,9 +55,9 @@ void Engine::loop() { try { systems.frame_update(); } catch (const exception & e) { - Log::logf(Log::Level::WARNING, "Uncaught exception in frame update function: {}\n", e.what()); + Log::logf(Log::Level::WARNING, "Uncaught exception in frame update function: {}\n", + e.what()); } timer.enforce_frame_rate(); } } - diff --git a/src/crepe/api/Engine.h b/src/crepe/api/Engine.h index efe7853..3145723 100644 --- a/src/crepe/api/Engine.h +++ b/src/crepe/api/Engine.h @@ -2,14 +2,13 @@ #include "../facade/SDLContext.h" #include "../manager/ComponentManager.h" +#include "../manager/EventManager.h" +#include "../manager/LoopTimerManager.h" #include "../manager/ReplayManager.h" #include "../manager/ResourceManager.h" -#include "../manager/ResourceManager.h" #include "../manager/SaveManager.h" #include "../manager/SceneManager.h" #include "../manager/SystemManager.h" -#include "../manager/LoopTimerManager.h" -#include "../manager/EventManager.h" namespace crepe { diff --git a/src/crepe/api/GameObject.cpp b/src/crepe/api/GameObject.cpp index 68b074e..9b94cad 100644 --- a/src/crepe/api/GameObject.cpp +++ b/src/crepe/api/GameObject.cpp @@ -7,13 +7,14 @@ using namespace crepe; using namespace std; -GameObject::GameObject(Mediator & mediator, game_object_id_t id, - const std::string & name, const std::string & tag, - const vec2 & position, double rotation, double scale) +GameObject::GameObject(Mediator & mediator, game_object_id_t id, const std::string & name, + const std::string & tag, const vec2 & position, double rotation, + double scale) : id(id), mediator(mediator), - transform(mediator.component_manager->add_component<Transform>(this->id, position, rotation, scale)), - metadata(mediator.component_manager->add_component<Metadata>(this->id, name, tag)) { } + transform(mediator.component_manager->add_component<Transform>(this->id, position, + rotation, scale)), + metadata(mediator.component_manager->add_component<Metadata>(this->id, name, tag)) {} void GameObject::set_parent(const GameObject & parent) { ComponentManager & mgr = this->mediator.component_manager; diff --git a/src/crepe/api/GameObject.h b/src/crepe/api/GameObject.h index 0dabed1..572ce3a 100644 --- a/src/crepe/api/GameObject.h +++ b/src/crepe/api/GameObject.h @@ -30,9 +30,8 @@ private: * \param rotation The rotation of the GameObject * \param scale The scale of the GameObject */ - GameObject(Mediator & mediator, game_object_id_t id, - const std::string & name, const std::string & tag, const vec2 & position, - double rotation, double scale); + GameObject(Mediator & mediator, game_object_id_t id, const std::string & name, + const std::string & tag, const vec2 & position, double rotation, double scale); //! ComponentManager instances GameObject friend class ComponentManager; diff --git a/src/crepe/api/ParticleEmitter.cpp b/src/crepe/api/ParticleEmitter.cpp index fd69e26..a9c5cf6 100644 --- a/src/crepe/api/ParticleEmitter.cpp +++ b/src/crepe/api/ParticleEmitter.cpp @@ -23,4 +23,3 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter & other) { data.particles = other.data.particles; return *this; } - diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp index 8b95cc9..34e7908 100644 --- a/src/crepe/api/Script.cpp +++ b/src/crepe/api/Script.cpp @@ -45,4 +45,3 @@ void Script::replay::release(recording_t recording) { ReplayManager & mgr = this->mediator->replay_manager; return mgr.release(recording); } - diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 18a029b..6536fa4 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -2,13 +2,13 @@ #include <vector> -#include "../manager/ReplayManager.h" #include "../manager/EventManager.h" #include "../manager/Mediator.h" +#include "../manager/ReplayManager.h" #include "../system/CollisionSystem.h" #include "../types.h" -#include "../util/OptionalRef.h" #include "../util/Log.h" +#include "../util/OptionalRef.h" namespace crepe { @@ -115,10 +115,12 @@ protected: void subscribe(const EventHandler<EventType> & callback); //! \copydoc EventManager::trigger_event template <typename EventType> - void trigger_event(const EventType & event = {}, event_channel_t channel = EventManager::CHANNEL_ALL); + void trigger_event(const EventType & event = {}, + event_channel_t channel = EventManager::CHANNEL_ALL); //! \copydoc EventManager::queue_event template <typename EventType> - void queue_event(const EventType & event = {}, event_channel_t channel = EventManager::CHANNEL_ALL); + void queue_event(const EventType & event = {}, + event_channel_t channel = EventManager::CHANNEL_ALL); //! \} /** diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp index b42a6df..4462a41 100644 --- a/src/crepe/api/Script.hpp +++ b/src/crepe/api/Script.hpp @@ -48,7 +48,8 @@ void Script::subscribe_internal(const EventHandler<EventType> & callback, try { ReplayManager & replay = this->mediator->replay_manager; if (replay.get_state() == ReplayManager::PLAYING) return false; - } catch (const std::runtime_error &) {} + } catch (const std::runtime_error &) { + } // call user-provided callback return callback(data); diff --git a/src/crepe/api/Transform.cpp b/src/crepe/api/Transform.cpp index 32b44e1..fcfce14 100644 --- a/src/crepe/api/Transform.cpp +++ b/src/crepe/api/Transform.cpp @@ -20,4 +20,3 @@ unique_ptr<Component> Transform::save() const { void Transform::restore(const Component & snapshot) { *this = static_cast<const Transform &>(snapshot); } - |