diff options
Diffstat (limited to 'src/crepe/manager/SystemManager.cpp')
-rw-r--r-- | src/crepe/manager/SystemManager.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/crepe/manager/SystemManager.cpp b/src/crepe/manager/SystemManager.cpp index eabc022..fea59aa 100644 --- a/src/crepe/manager/SystemManager.cpp +++ b/src/crepe/manager/SystemManager.cpp @@ -31,17 +31,31 @@ 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() + ); + } } } |