From 135af8b0e0eaf8a5a5b7e1a42bfb20bb14ec97e5 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Mon, 2 Dec 2024 18:51:47 +0100 Subject: tmp commit --- src/crepe/system/AnimatorSystem.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/crepe/system') 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 using namespace crepe; @@ -25,11 +26,11 @@ void AnimatorSystem::update() { int curr_frame = static_cast(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; } } -- cgit v1.2.3