From d2846140ee541a2daff13642f60da452d9a6ef8e Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Thu, 19 Dec 2024 21:28:16 +0100 Subject: added const --- src/crepe/system/InputSystem.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/crepe/system') diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index cd6091d..cdcd8c7 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -12,7 +12,7 @@ void InputSystem::update() { ComponentManager & mgr = this->mediator.component_manager; SDLContext & context = this->mediator.sdl_context; std::vector event_list = context.get_events(); - RefVector cameras = mgr.get_components_by_type(); + const RefVector cameras = mgr.get_components_by_type(); OptionalRef curr_cam_ref; // Find the active camera @@ -24,7 +24,7 @@ void InputSystem::update() { if (!curr_cam_ref) return; Camera & current_cam = curr_cam_ref; - Transform & cam_transform + const Transform & cam_transform = mgr.get_components_by_id(current_cam.game_object_id).front(); vec2 camera_origin = cam_transform.position + current_cam.data.postion_offset @@ -155,16 +155,16 @@ void InputSystem::handle_move(const EventData & event_data, const vec2 & mouse_p const Camera & current_cam) { ComponentManager & mgr = this->mediator.component_manager; EventManager & event_mgr = this->mediator.event_manager; - RefVector