diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-14 12:06:13 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-14 12:06:13 +0100 |
commit | 332fd8a0df85062e8474acab84b469afeb89f72b (patch) | |
tree | a06cf5beaadb721b18c1add881282e12b4a38a99 /src/crepe/system/AnimatorSystem.cpp | |
parent | 8e72da5b2fec93be40f0c0a7f3199fc12f7681c9 (diff) | |
parent | b9fc66f6922b1f40f2dbe14e8dfc4caa469654bc (diff) |
merge master
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r-- | src/crepe/system/AnimatorSystem.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp index d61ba35..107b25d 100644 --- a/src/crepe/system/AnimatorSystem.cpp +++ b/src/crepe/system/AnimatorSystem.cpp @@ -2,21 +2,24 @@ #include "../api/Animator.h" #include "../manager/ComponentManager.h" -#include "api/LoopTimer.h" +#include "../manager/LoopTimerManager.h" +#include <chrono> #include "AnimatorSystem.h" using namespace crepe; +using namespace std::chrono; void AnimatorSystem::update() { ComponentManager & mgr = this->mediator.component_manager; - LoopTimer & timer = this->mediator.timer; + LoopTimerManager & timer = this->mediator.loop_timer; RefVector<Animator> animations = mgr.get_components_by_type<Animator>(); - double elapsed_time = timer.get_current_time(); + float elapsed_time = duration_cast<duration<float>>(timer.get_elapsed_time()).count(); for (Animator & a : animations) { if (!a.active) continue; + if (a.data.fps == 0) continue; Animator::Data & ctx = a.data; float frame_duration = 1.0f / ctx.fps; |