From 7e12ebdf945d40d6f11872cf5852c9bb54d1864f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 22 Dec 2024 16:12:31 +0100 Subject: big WIP --- src/crepe/manager/SystemManager.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/crepe/manager/SystemManager.cpp') diff --git a/src/crepe/manager/SystemManager.cpp b/src/crepe/manager/SystemManager.cpp index eabc022..c8f4f3d 100644 --- a/src/crepe/manager/SystemManager.cpp +++ b/src/crepe/manager/SystemManager.cpp @@ -31,17 +31,25 @@ SystemManager::SystemManager(Mediator & mediator) : Manager(mediator) { this->mediator.system_manager = *this; } -void SystemManager::fixed_update() { - for (System & system : this->system_order) { - if (!system.active) continue; - system.fixed_update(); +void SystemManager::fixed_update() noexcept { + for (SystemEntry & entry : this->system_order) { + if (!entry.system.active) continue; + try { + entry.system.fixed_update(); + } catch (const exception & e) { + Log::logf(Log::Level::WARNING, "Uncaught exception in {} fixed update: {}", entry.name, e.what()); + } } } -void SystemManager::frame_update() { - for (System & system : this->system_order) { - if (!system.active) continue; - system.frame_update(); +void SystemManager::frame_update() noexcept { + for (SystemEntry & entry : this->system_order) { + if (!entry.system.active) continue; + try { + entry.system.frame_update(); + } catch (const exception & e) { + Log::logf(Log::Level::WARNING, "Uncaught exception in {} frame update: {}", entry.name, e.what()); + } } } -- cgit v1.2.3