aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/AnimatorSystem.cpp4
-rw-r--r--src/crepe/system/RenderSystem.cpp11
2 files changed, 6 insertions, 9 deletions
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index e5b277f..4c40940 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -18,7 +18,7 @@ void AnimatorSystem::update() {
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;
+ a.spritesheet.mask.x = (a.curr_row * a.spritesheet.mask.w) + a.curr_col;
+ a.spritesheet.mask = a.spritesheet.mask;
}
}
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 8895f02..c196bb1 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -77,31 +77,28 @@ bool RenderSystem::render_particle(const Sprite & sprite, const Camera & cam,
for (const Particle & p : em.data.particles) {
if (!p.active) continue;
- RenderCtx ctx{
+ this->context.draw(SDLContext::RenderContext{
.sprite = sprite,
.cam = cam,
.cam_pos = this->cam_pos,
.pos = p.position,
.angle = p.angle,
.scale = scale,
- };
- this->context.draw(ctx);
+ });
}
}
return rendering_particles;
}
void RenderSystem::render_normal(const Sprite & sprite, const Camera & cam,
const Transform & tm) {
-
- RenderCtx ctx{
+ this->context.draw(SDLContext::RenderContext{
.sprite = sprite,
.cam = cam,
.cam_pos = this->cam_pos,
.pos = tm.position,
.angle = tm.rotation,
.scale = tm.scale,
- };
- this->context.draw(ctx);
+ });
}
void RenderSystem::render() {