aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 15:42:25 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 15:42:25 +0100
commit7ec1fcfcff0c01d204ccbf1bac9919ba610b8606 (patch)
treecd48865b6af69a0d71a70a720b843b4b681f53bb /src/crepe/system
parent3fbe1a5c72e7512a330111665482a5babf21cc15 (diff)
implemented final max feedback
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/InputSystem.cpp4
-rw-r--r--src/crepe/system/RenderSystem.cpp2
-rw-r--r--src/crepe/system/RenderSystem.h3
3 files changed, 4 insertions, 5 deletions
diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp
index 20da644..aaa8bdf 100644
--- a/src/crepe/system/InputSystem.cpp
+++ b/src/crepe/system/InputSystem.cpp
@@ -24,9 +24,9 @@ void InputSystem::update() {
RefVector<Transform> transform_vec
= mgr.get_components_by_id<Transform>(current_cam.game_object_id);
Transform & cam_transform = transform_vec.front().get();
- int camera_origin_x = cam_transform.position.x + current_cam.data.offset.x
+ int camera_origin_x = cam_transform.position.x + current_cam.data.postion_offset.x
- (current_cam.viewport_size.x / 2);
- int camera_origin_y = cam_transform.position.y + current_cam.data.offset.y
+ int camera_origin_y = cam_transform.position.y + current_cam.data.postion_offset.y
- (current_cam.viewport_size.y / 2);
for (const SDLContext::EventData & event : event_list) {
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 111ad7d..0ba71ec 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -33,7 +33,7 @@ SDLContext::CameraValues RenderSystem::update_camera() {
const Transform & transform
= mgr.get_components_by_id<Transform>(cam.game_object_id).front().get();
SDLContext::CameraValues cam_val = this->context.set_camera(cam);
- cam_val.cam_pos = transform.position + cam.data.offset;
+ cam_val.cam_pos = transform.position + cam.data.postion_offset;
return cam_val;
}
throw std::runtime_error("No active cameras in current scene");
diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h
index eaf1213..91b386f 100644
--- a/src/crepe/system/RenderSystem.h
+++ b/src/crepe/system/RenderSystem.h
@@ -79,8 +79,7 @@ private:
*/
private:
- // FIXME: retrieve sdlcontext via mediator after #PR57
- SDLContext & context = SDLContext::get_instance();
+ SDLContext & context = this->mediator.sdl_context;
};
} // namespace crepe