From db181bafbe57e8df5f1df5c0871865701ac62ecc Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Tue, 3 Dec 2024 12:39:41 +0100 Subject: make format --- src/crepe/system/InputSystem.cpp | 43 ++++++++++++++++++++++------------------ src/crepe/system/InputSystem.h | 33 ++++++++++++++++-------------- 2 files changed, 42 insertions(+), 34 deletions(-) (limited to 'src/crepe/system') diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 1cd3974..0cf5af1 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -6,7 +6,6 @@ using namespace crepe; - void InputSystem::update() { ComponentManager & mgr = this->component_manager; EventManager & event_mgr = EventManager::get_instance(); @@ -21,11 +20,14 @@ void InputSystem::update() { break; } if (!curr_cam_ref) return; - Camera& current_cam = curr_cam_ref; - RefVector transform_vec = mgr.get_components_by_id(current_cam.game_object_id); - Transform& cam_transform = transform_vec.front().get(); - int camera_origin_x = cam_transform.position.x + current_cam.offset.x - (current_cam.viewport_size.x / 2); - int camera_origin_y = cam_transform.position.y + current_cam.offset.y - (current_cam.viewport_size.y / 2); + Camera & current_cam = curr_cam_ref; + RefVector transform_vec + = mgr.get_components_by_id(current_cam.game_object_id); + Transform & cam_transform = transform_vec.front().get(); + int camera_origin_x + = cam_transform.position.x + current_cam.offset.x - (current_cam.viewport_size.x / 2); + int camera_origin_y + = cam_transform.position.y + current_cam.offset.y - (current_cam.viewport_size.y / 2); for (const SDLContext::EventData & event : event_list) { int world_mouse_x = event.mouse_position.first + camera_origin_x; int world_mouse_y = event.mouse_position.second + camera_origin_y; @@ -98,7 +100,8 @@ void InputSystem::update() { } } -void InputSystem::handle_move(const SDLContext::EventData & event_data, const int& world_mouse_x, const int& world_mouse_y) { +void InputSystem::handle_move(const SDLContext::EventData & event_data, + const int & world_mouse_x, const int & world_mouse_y) { ComponentManager & mgr = this->component_manager; RefVector