aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 15:01:58 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 15:01:58 +0100
commit68c9e7511ea52c6ee70d052bbdf2923cd68bfa8a (patch)
tree508bfd76d4759eab936300531c7a468aaf740cf2 /src/crepe/api
parente49893e8de74534494792955c50ea0eabaf3ba38 (diff)
`make format`wouter/gameloop
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/LoopManager.cpp8
-rw-r--r--src/crepe/api/LoopManager.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp
index aa4a21a..b5e5ff7 100644
--- a/src/crepe/api/LoopManager.cpp
+++ b/src/crepe/api/LoopManager.cpp
@@ -1,4 +1,6 @@
#include "../facade/SDLContext.h"
+#include "../manager/EventManager.h"
+#include "../manager/LoopTimerManager.h"
#include "../system/AISystem.h"
#include "../system/AnimatorSystem.h"
#include "../system/AudioSystem.h"
@@ -8,8 +10,6 @@
#include "../system/PhysicsSystem.h"
#include "../system/RenderSystem.h"
#include "../system/ScriptSystem.h"
-#include "../manager/EventManager.h"
-#include "../manager/LoopTimerManager.h"
#include "../util/Log.h"
#include "LoopManager.h"
@@ -54,7 +54,7 @@ void LoopManager::loop() {
this->frame_update();
this->loop_timer.enforce_frame_rate();
}
- }catch(const exception & e){
+ } catch (const exception & e) {
Log::logf(Log::Level::ERROR, "Exception caught in main loop: {}", e.what());
this->event_manager.trigger_event<ShutDownEvent>(ShutDownEvent{});
}
@@ -72,7 +72,7 @@ void LoopManager::fixed_update() {
}
// will be called every frame
-void LoopManager::frame_update() {
+void LoopManager::frame_update() {
this->scene_manager.load_next_scene();
this->get_system<AnimatorSystem>().update();
//render
diff --git a/src/crepe/api/LoopManager.h b/src/crepe/api/LoopManager.h
index 0110695..487f07a 100644
--- a/src/crepe/api/LoopManager.h
+++ b/src/crepe/api/LoopManager.h
@@ -69,6 +69,7 @@ private:
//! Indicates whether the game is running.
bool game_running = false;
+
private:
//! Global context
Mediator mediator;
@@ -90,7 +91,6 @@ private:
SDLContext & sdl_context = SDLContext::get_instance();
private:
-
/**
* \brief Callback function for ShutDownEvent
*