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.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index c196bb1..944ac86 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -32,8 +32,8 @@ const Camera & RenderSystem::update_camera() {
if (!cam.active) continue;
const Transform & transform
= mgr.get_components_by_id<Transform>(cam.game_object_id).front().get();
- this->context.set_camera(cam);
- this->cam_pos = transform.position + cam.offset;
+ this->context.set_camera(cam, this->cam_ctx);
+ this->cam_ctx.cam_pos = transform.position + cam.offset;
return cam;
}
throw std::runtime_error("No active cameras in current scene");
@@ -79,8 +79,7 @@ bool RenderSystem::render_particle(const Sprite & sprite, const Camera & cam,
this->context.draw(SDLContext::RenderContext{
.sprite = sprite,
- .cam = cam,
- .cam_pos = this->cam_pos,
+ .cam = this->cam_ctx,
.pos = p.position,
.angle = p.angle,
.scale = scale,
@@ -93,8 +92,7 @@ void RenderSystem::render_normal(const Sprite & sprite, const Camera & cam,
const Transform & tm) {
this->context.draw(SDLContext::RenderContext{
.sprite = sprite,
- .cam = cam,
- .cam_pos = this->cam_pos,
+ .cam = this->cam_ctx,
.pos = tm.position,
.angle = tm.rotation,
.scale = tm.scale,