diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-02 18:51:47 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-02 18:51:47 +0100 |
commit | 135af8b0e0eaf8a5a5b7e1a42bfb20bb14ec97e5 (patch) | |
tree | c82dfadea7af5874f274ad105e94f05af19a9860 /src/crepe/system | |
parent | 54ab44e3508d526be6275378e5979290ec188d6f (diff) |
tmp commit
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/AnimatorSystem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp index ee00728..1650b3d 100644 --- a/src/crepe/system/AnimatorSystem.cpp +++ b/src/crepe/system/AnimatorSystem.cpp @@ -4,6 +4,7 @@ #include "AnimatorSystem.h" #include "ComponentManager.h" +#include <iostream> using namespace crepe; @@ -25,11 +26,11 @@ void AnimatorSystem::update() { int curr_frame = static_cast<int>(elapsed_time / frame_duration) % total_frames; a.curr_row = a.cycle_start + curr_frame; - a.spritesheet.mask.x = std::clamp((a.curr_row * a.spritesheet.mask.w - a.offset_x), 0, - a.spritesheet.mask.w); + a.spritesheet.mask.x = a.curr_row * a.spritesheet.mask.w; a.spritesheet.mask.y = (a.curr_col * a.spritesheet.mask.h); - - if (!a.looping && curr_frame == total_frames) { + + std::cout << curr_frame << " " << total_frames << std::endl; + if (!a.looping && curr_frame == 0) { a.active = false; } } |