aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-09 20:15:41 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-09 20:15:41 +0100
commita597b0059f30e9d56331c6ece34fdcabb4028616 (patch)
tree09da85838764dc25f020a14a17937267a686590c /src/crepe/system
parent4d74c80d9c3c9fdca9b07d960a1f9fd3e38cdfad (diff)
making rendering fonts and UI
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/RenderSystem.cpp4
-rw-r--r--src/crepe/system/RenderSystem.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 26f2c85..74fed26 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -27,7 +27,7 @@ void RenderSystem::present_screen() {
ctx.present_screen();
}
-SDLContext::CameraValues RenderSystem::update_camera() {
+SDLContext::CameraValues & RenderSystem::update_camera() {
ComponentManager & mgr = this->mediator.component_manager;
SDLContext & ctx = this->mediator.sdl_context;
RefVector<Camera> cameras = mgr.get_components_by_type<Camera>();
@@ -38,7 +38,7 @@ SDLContext::CameraValues RenderSystem::update_camera() {
if (!cam.active) continue;
const Transform & transform
= mgr.get_components_by_id<Transform>(cam.game_object_id).front().get();
- SDLContext::CameraValues cam_val = ctx.set_camera(cam);
+ SDLContext::CameraValues & cam_val = ctx.set_camera(cam);
cam_val.cam_pos = transform.position + cam.data.postion_offset;
return cam_val;
}
diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h
index e270a6b..de26aa8 100644
--- a/src/crepe/system/RenderSystem.h
+++ b/src/crepe/system/RenderSystem.h
@@ -37,7 +37,7 @@ private:
void present_screen();
//! Updates the active camera used for rendering.
- SDLContext::CameraValues update_camera();
+ SDLContext::CameraValues & update_camera();
//! Renders the whole screen
void render();