aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AnimatorSystem.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-04 10:56:53 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-04 10:56:53 +0100
commita11824956b478e356fa684c9d88b980aa22cb19a (patch)
treed743b0415040d68db4f5cf35b2fc58bab41f0e46 /src/crepe/system/AnimatorSystem.cpp
parent683ae28b81a66f18bbadbe7ae70eb8ddd952c293 (diff)
implemented feedback, cameraValues need better name?
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index e9cdd4c..a2ae529 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -22,14 +22,14 @@ void AnimatorSystem::update() {
int last_frame = ctx.curr_row;
- int cycle_end = (ctx.cycle_end == -1) ? ctx.row : ctx.cycle_end;
+ int cycle_end = (ctx.cycle_end == -1) ? a.row : ctx.cycle_end;
int total_frames = cycle_end - ctx.cycle_start;
int curr_frame = static_cast<int>(elapsed_time / frame_duration) % total_frames;
ctx.curr_row = ctx.cycle_start + curr_frame;
- ctx.spritesheet.mask.x = ctx.curr_row * ctx.spritesheet.mask.w;
- ctx.spritesheet.mask.y = (ctx.curr_col * ctx.spritesheet.mask.h);
+ a.spritesheet.mask.x = ctx.curr_row * a.spritesheet.mask.w;
+ a.spritesheet.mask.y = (ctx.curr_col * a.spritesheet.mask.h);
if (!ctx.looping && curr_frame == ctx.cycle_start && last_frame == total_frames - 1) {
a.active = false;