aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AnimatorSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp9
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;
}
}