From f0ecbea57a4d75905c4ee79608807187cd8f3e72 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 11 Dec 2024 16:51:03 +0100 Subject: WIP --- src/crepe/api/LoopManager.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/crepe/api/LoopManager.cpp') diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp index 637fbe1..ff428fd 100644 --- a/src/crepe/api/LoopManager.cpp +++ b/src/crepe/api/LoopManager.cpp @@ -13,18 +13,17 @@ using namespace crepe; using namespace std; -LoopManager::LoopManager() - : systems({ - ScriptSystem{this->mediator}, - PhysicsSystem{this->mediator}, - CollisionSystem{this->mediator}, - AnimatorSystem{this->mediator}, - ParticleSystem{this->mediator}, - RenderSystem{this->mediator}, - InputSystem{this->mediator}, - EventSystem{this->mediator}, - AudioSystem{this->mediator}, - }) { } +LoopManager::LoopManager() { + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); + this->load_system(); +} void LoopManager::start() { this->setup(); @@ -32,16 +31,16 @@ void LoopManager::start() { } void LoopManager::fixed_update() { - for (System & system : this->systems) { - if (!system.active) continue; - system.fixed_update(); + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->fixed_update(); } } void LoopManager::frame_update() { - for (System & system : this->systems) { - if (!system.active) continue; - system.frame_update(); + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->frame_update(); } } -- cgit v1.2.3