aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AnimatorSystem.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-30 21:03:11 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-30 21:03:11 +0100
commit3afcae9dd472ead2d5f2b667fc6479f8ee6db10c (patch)
tree9fda1dc74d453a1f68796b5a0987ba5e32339a21 /src/crepe/system/AnimatorSystem.cpp
parent6ae0b9038e432869b506cbdfe2779e97d3732d87 (diff)
make format
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index 6a84150..ee00728 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -22,11 +22,11 @@ void AnimatorSystem::update() {
int cycle_end = (a.cycle_end == -1) ? a.row : cycle_end;
int total_frames = cycle_end - a.cycle_start;
-
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 = std::clamp((a.curr_row * a.spritesheet.mask.w - a.offset_x), 0,
+ a.spritesheet.mask.w);
a.spritesheet.mask.y = (a.curr_col * a.spritesheet.mask.h);
if (!a.looping && curr_frame == total_frames) {