aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AnimatorSystem.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 20:12:31 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 20:12:31 +0100
commit88f613cbb2e4aaf3ed55ac0c6490706dd6f6f19d (patch)
tree8db09f0a0f27dc552356a6c5513589245e9ff7b7 /src/crepe/system/AnimatorSystem.cpp
parent9288e4964526f1ce6b7d0aca0f075a04f56ede32 (diff)
rendering based on world unites instead of pixels
Diffstat (limited to 'src/crepe/system/AnimatorSystem.cpp')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index 9d18873..ceb5bfd 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -3,8 +3,8 @@
#include <vector>
#include "api/Animator.h"
-#include "facade/SDLContext.h"
+#include "facade/SDLContext.h"
#include "AnimatorSystem.h"
#include "ComponentManager.h"
@@ -19,6 +19,7 @@ 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;