aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-13 17:42:34 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-13 17:42:34 +0100
commit3a23e41255af0de3c5c7f5d9df981c8b205e291f (patch)
tree50593d45598dd60eecafef514ef4fe3e9957b845 /src/crepe/system
parentc5667ee90d7d542aa9984eb31b48b59d6240119b (diff)
add timer functionality to script
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/ScriptSystem.cpp5
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);
}
}