aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-06 11:26:23 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-06 11:26:23 +0100
commit958475050c80addf584b6a166649c337c68a879f (patch)
tree9b133018aeb2ec278f78a5affe2f72a7a7e678c0 /src/crepe/system
parentf693119c9e102a9b51a1015168ee2a56f2309dd1 (diff)
make format with small adjustment system
Diffstat (limited to 'src/crepe/system')
-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 1a0cde9..ec9a445 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -34,14 +34,15 @@ void AnimatorSystem::frame_update() {
int total_frames = cycle_end - ctx.cycle_start;
int curr_cycle_frame = (a.frame - ctx.cycle_start) % total_frames;
+ if (!ctx.looping && a.frame >= cycle_end) {
+ a.active = false;
+ continue;
+ }
+
ctx.row = (ctx.cycle_start + curr_cycle_frame) % a.grid_size.x;
ctx.col = curr_cycle_frame / a.grid_size.x;
a.spritesheet.mask.x = ctx.row * a.spritesheet.mask.w;
a.spritesheet.mask.y = ctx.col * a.spritesheet.mask.y;
-
- if (!ctx.looping && a.frame >= cycle_end) {
- a.active = false;
- }
}
}