aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
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
parent9288e4964526f1ce6b7d0aca0f075a04f56ede32 (diff)
rendering based on world unites instead of pixels
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp3
-rw-r--r--src/crepe/system/AnimatorSystem.h3
-rw-r--r--src/crepe/system/RenderSystem.cpp1
3 files changed, 3 insertions, 4 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;
diff --git a/src/crepe/system/AnimatorSystem.h b/src/crepe/system/AnimatorSystem.h
index 56cc7b3..f8179a9 100644
--- a/src/crepe/system/AnimatorSystem.h
+++ b/src/crepe/system/AnimatorSystem.h
@@ -21,12 +21,11 @@ public:
/**
* \brief Updates the Animator components.
*
- * This method is called periodically (likely every frame) to update the state of all
+ * This method is called to update the state of all
* Animator components, moving the animations forward and managing their behavior (e.g.,
* looping).
*/
void update() override;
- // FIXME: never say "likely" in the documentation lmao
};
} // namespace crepe
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index fa3d0de..989a82f 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -5,7 +5,6 @@
#include "../api/Sprite.h"
#include "../api/Transform.h"
#include "../facade/SDLContext.h"
-#include "../util/Log.h"
#include "RenderSystem.h"