diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-28 10:04:14 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-28 10:04:14 +0100 |
commit | 2d623522db0677ca5e88a53e3705a10ce59ba8b6 (patch) | |
tree | dd5acb4f0ab54e6f0e284181d9ee51e5ba4a7ce6 /src/crepe/system | |
parent | 71be3e36dbb402c3e84d87ea0255c08cb2a1b7ca (diff) |
removed animator rectangle
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/AnimatorSystem.cpp | 11 | ||||
-rw-r--r-- | src/crepe/system/RenderSystem.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp index bc94253..e5b277f 100644 --- a/src/crepe/system/AnimatorSystem.cpp +++ b/src/crepe/system/AnimatorSystem.cpp @@ -15,11 +15,10 @@ void AnimatorSystem::update() { uint64_t tick = SDLContext::get_instance().get_ticks(); for (Animator & a : animations) { - if (a.active) { - // (10 frames per second) - a.curr_row = (tick / 100) % a.row; - a.animator_rect.x = (a.curr_row * a.animator_rect.w) + a.curr_col; - a.spritesheet.sprite_rect = a.animator_rect; - } + if (!a.active) continue; + // (10 frames per second) + a.curr_row = (tick / 100) % a.row; + a.spritesheet.sprite_rect.x = (a.curr_row * a.spritesheet.sprite_rect.w) + a.curr_col; + a.spritesheet.sprite_rect = a.spritesheet.sprite_rect; } } diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h index 4667424..7279b5c 100644 --- a/src/crepe/system/RenderSystem.h +++ b/src/crepe/system/RenderSystem.h @@ -79,7 +79,7 @@ private: SDLContext & context = SDLContext::get_instance(); //! camera postion in the current scene - vec2 cam_pos = {0,0}; + vec2 cam_pos; }; |