From e20263f4c6b4c354baa301b21a6ac1fb0a7d5848 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 18 Dec 2024 14:44:01 +0100 Subject: make format --- src/crepe/system/InputSystem.cpp | 39 ++++++++++++++++++++++++--------------- src/crepe/system/InputSystem.h | 6 ++++-- src/test/InputTest.cpp | 3 ++- 3 files changed, 30 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 12437f7..2d21572 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -26,8 +26,9 @@ void InputSystem::update() { if (!curr_cam_ref) return; Camera & current_cam = curr_cam_ref; - Transform & cam_transform = mgr.get_components_by_id(current_cam.game_object_id).front(); - + 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 - (current_cam.viewport_size / 2); @@ -83,7 +84,8 @@ void InputSystem::handle_mouse_event(const EventData & event, const vec2 & camer .mouse_pos = adjusted_mouse, .button = event.data.mouse_data.mouse_button, }); - this->handle_click(event.data.mouse_data.mouse_button, adjusted_mouse,current_cam); + this->handle_click(event.data.mouse_data.mouse_button, adjusted_mouse, + current_cam); } break; } @@ -93,7 +95,7 @@ void InputSystem::handle_mouse_event(const EventData & event, const vec2 & camer .mouse_pos = adjusted_mouse, .mouse_delta = event.data.mouse_data.rel_mouse_move, }); - this->handle_move(event, adjusted_mouse,current_cam); + this->handle_move(event, adjusted_mouse, current_cam); break; case EventType::MOUSE_WHEEL: @@ -151,7 +153,8 @@ void InputSystem::handle_non_mouse_event(const EventData & event) { } } -void InputSystem::handle_move(const EventData & event_data, const vec2 & mouse_pos, const Camera & current_cam) { +void InputSystem::handle_move(const EventData & event_data, const vec2 & mouse_pos, + const Camera & current_cam) { ComponentManager & mgr = this->mediator.component_manager; RefVector