diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
commit | 0f68177a0384d41a7feff36cc0e1869b6d2ac9aa (patch) | |
tree | 4904b60820858efd0ee6ece0af1f2c1fc5846ec5 /src/crepe/system/AnimatorSystem.cpp | |
parent | 73f8d5c558ebc0820ede241e64a876ff1c5ccefb (diff) | |
parent | 194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/inputSystem
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r-- | src/crepe/system/AnimatorSystem.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp index 549c35d..31eb85c 100644 --- a/src/crepe/system/AnimatorSystem.cpp +++ b/src/crepe/system/AnimatorSystem.cpp @@ -2,7 +2,7 @@ #include "../api/Animator.h" #include "../manager/ComponentManager.h" -#include "api/LoopTimer.h" +#include "../manager/LoopTimerManager.h" #include "AnimatorSystem.h" @@ -10,10 +10,10 @@ using namespace crepe; 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(); + unsigned long long elapsed_time = timer.get_elapsed_time().count(); for (Animator & a : animations) { if (!a.active) continue; @@ -23,7 +23,7 @@ void AnimatorSystem::update() { int last_frame = ctx.row; - int cycle_end = (ctx.cycle_end == -1) ? a.max_rows : ctx.cycle_end; + int cycle_end = (ctx.cycle_end == -1) ? a.grid_size.x : ctx.cycle_end; int total_frames = cycle_end - ctx.cycle_start; int curr_frame = static_cast<int>(elapsed_time / frame_duration) % total_frames; |