aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-10 16:21:05 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-10 16:21:05 +0100
commit7b8de90699aea153e73b5f2cee05c69b966b81be (patch)
tree123f8b71b59a933b2bfcffb9e43e5bea66086d8f /src/crepe/system
parent33cd5566909ac089cdf56db38a3d1daf0cb7dd10 (diff)
implemented feedback wouter, improved animator. however if spritesheet aspect_ratio is not the same as the single frame then the scaling is wrong
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp2
-rw-r--r--src/crepe/system/RenderSystem.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index 549c35d..bb22b62 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -23,7 +23,7 @@ void AnimatorSystem::update() {
int last_frame = ctx.row;
- int cycle_end = (ctx.cycle_end == -1) ? a.max_rows : ctx.cycle_end;
+ int cycle_end = (ctx.cycle_end == -1) ? a.max_cell_size.x : ctx.cycle_end;
int total_frames = cycle_end - ctx.cycle_start;
int curr_frame = static_cast<int>(elapsed_time / frame_duration) % total_frames;
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index daf71c5..51340fb 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -10,9 +10,10 @@
#include "../api/Sprite.h"
#include "../api/Transform.h"
#include "../facade/SDLContext.h"
+#include "../facade/Texture.h"
#include "../manager/ComponentManager.h"
-#include "api/Texture.h"
-#include "manager/ResourceManager.h"
+#include "../manager/ResourceManager.h"
+
#include "RenderSystem.h"
using namespace crepe;