aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/RenderSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r--src/crepe/system/RenderSystem.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index afd9548..c0717fc 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -13,6 +13,7 @@
#include "../facade/Texture.h"
#include "../manager/ComponentManager.h"
#include "../manager/ResourceManager.h"
+#include "util/AbsoluutPosition.h"
#include "RenderSystem.h"
#include "types.h"
@@ -83,11 +84,11 @@ bool RenderSystem::render_particle(const Sprite & sprite, const double & scale)
bool rendering_particles = false;
for (const ParticleEmitter & em : emitters) {
- if (&em.data.sprite != &sprite) continue;
+ if (&em.sprite != &sprite) continue;
rendering_particles = true;
if (!em.active) continue;
- for (const Particle & p : em.data.particles) {
+ for (const Particle & p : em.particles) {
if (!p.active) continue;
ctx.draw(SDLContext::RenderContext{
@@ -105,11 +106,11 @@ void RenderSystem::render_normal(const Sprite & sprite, const Transform & tm) {
SDLContext & ctx = this->mediator.sdl_context;
ResourceManager & resource_manager = this->mediator.resource_manager;
const Texture & res = resource_manager.get<Texture>(sprite.source);
-
+ vec2 pos = AbsoluutPosition::get_position(tm, sprite.data.position_offset);
ctx.draw(SDLContext::RenderContext{
.sprite = sprite,
.texture = res,
- .pos = tm.position,
+ .pos = pos,
.angle = tm.rotation,
.scale = tm.scale,
});