diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-13 17:42:34 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-13 17:42:34 +0100 |
commit | 3a23e41255af0de3c5c7f5d9df981c8b205e291f (patch) | |
tree | 50593d45598dd60eecafef514ef4fe3e9957b845 /src/crepe/system | |
parent | c5667ee90d7d542aa9984eb31b48b59d6240119b (diff) |
add timer functionality to script
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/ScriptSystem.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/crepe/system/ScriptSystem.cpp b/src/crepe/system/ScriptSystem.cpp index d6b2ca1..4afd2ba 100644 --- a/src/crepe/system/ScriptSystem.cpp +++ b/src/crepe/system/ScriptSystem.cpp @@ -11,6 +11,7 @@ void ScriptSystem::update() { dbg_trace(); ComponentManager & mgr = this->mediator.component_manager; + LoopTimerManager & timer = this->mediator.loop_timer; RefVector<BehaviorScript> behavior_scripts = mgr.get_components_by_type<BehaviorScript>(); for (BehaviorScript & behavior_script : behavior_scripts) { @@ -23,6 +24,8 @@ void ScriptSystem::update() { script->init(); script->initialized = true; } - script->update(); + + duration_t delta_time = timer.get_delta_time(); + script->update(delta_time); } } |