From 137b36ded2d67e0ff636fe4e936e16d5a7a3e90f Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 27 Nov 2024 14:51:55 +0100 Subject: small {} changes --- src/crepe/system/InputSystem.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/crepe/system') diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index dc5efff..bb67e5f 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -12,20 +12,18 @@ void InputSystem::update() { for (const SDLContext::EventData & event : event_list) { switch (event.event_type) { - case SDLContext::EventType::KEYDOWN: { + case SDLContext::EventType::KEYDOWN: event_mgr.queue_event(KeyPressEvent{ .repeat = event.key_repeat, .key = event.key, }); break; - } - case SDLContext::EventType::KEYUP: { + case SDLContext::EventType::KEYUP: event_mgr.queue_event(KeyReleaseEvent{ .key = event.key, }); break; - } - case SDLContext::EventType::MOUSEDOWN: { + case SDLContext::EventType::MOUSEDOWN: event_mgr.queue_event(MousePressEvent{ .mouse_x = event.mouse_position.first, .mouse_y = event.mouse_position.second, @@ -34,7 +32,6 @@ void InputSystem::update() { last_mouse_down_position = event.mouse_position; last_mouse_button = event.mouse_button; break; - } case SDLContext::EventType::MOUSEUP: { event_mgr.queue_event(MouseReleaseEvent{ .mouse_x = event.mouse_position.first, @@ -56,9 +53,9 @@ void InputSystem::update() { handle_click(event); } - break; } - case SDLContext::EventType::MOUSEMOVE: { + break; + case SDLContext::EventType::MOUSEMOVE: event_mgr.queue_event(MouseMoveEvent{ .mouse_x = event.mouse_position.first, .mouse_y = event.mouse_position.second, @@ -67,19 +64,16 @@ void InputSystem::update() { }); handle_move(event); break; - } - case SDLContext::EventType::MOUSEWHEEL: { + case SDLContext::EventType::MOUSEWHEEL: event_mgr.queue_event(MouseScrollEvent{ .scroll_x = event.wheel_delta, .scroll_y = 0, .direction = event.wheel_delta, }); break; - } - case SDLContext::EventType::SHUTDOWN: { + case SDLContext::EventType::SHUTDOWN: event_mgr.queue_event(ShutDownEvent{}); break; - } default: break; } -- cgit v1.2.3