diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 16:50:42 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 16:50:42 +0100 |
commit | 9cce00687e9ee318d72fd66793d070da2424fcbc (patch) | |
tree | 792c7f74ceb6e15ca317b4d37ff601a5dd25b9af /src/crepe/system/InputSystem.cpp | |
parent | 2a2e991371fc1164015df045227a6535137e74bc (diff) |
feedback changes
Diffstat (limited to 'src/crepe/system/InputSystem.cpp')
-rw-r--r-- | src/crepe/system/InputSystem.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 72d728c..dca621e 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -11,11 +11,11 @@ void InputSystem::update() { std::vector<SDLContext::EventData> event_list = SDLContext::get_instance().get_events(); RefVector<Button> buttons = mgr.get_components_by_type<Button>(); RefVector<Camera> cameras = mgr.get_components_by_type<Camera>(); - + OptionalRef<Camera> curr_cam_ref; // Find the active camera for (Camera & cam : cameras) { if (!cam.active) continue; - this->curr_cam_ref = cam; + curr_cam_ref = cam; break; } if (!curr_cam_ref) return; @@ -123,8 +123,7 @@ void InputSystem::handle_move(const SDLContext::EventData & event_data, for (Button & button : buttons) { RefVector<Transform> transform_vec = mgr.get_components_by_id<Transform>(button.game_object_id); - OptionalRef<Transform> transform(transform_vec.front().get()); - if (!transform) continue; + Transform & transform(transform_vec.front().get()); bool was_hovering = button.hover; if (button.active |