diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 22:57:45 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 22:57:45 +0100 |
commit | 26c3fb80fd3bf84968a1e464df518a0b6db6c5d9 (patch) | |
tree | ca3a964f1de0357097ae59024881c27c50751d86 /src/crepe | |
parent | a199b953d634426b48224487b478649e3937ee10 (diff) |
fixed changes with mediator
Diffstat (limited to 'src/crepe')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 2 | ||||
-rw-r--r-- | src/crepe/system/InputSystem.cpp | 13 | ||||
-rw-r--r-- | src/crepe/system/InputSystem.h | 3 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index aba7ce7..645a24f 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -17,7 +17,7 @@ #include "../api/Camera.h" #include "../api/Config.h" -#include "../api/EventManager.h" +#include "../manager/EventManager.h" #include "../api/Sprite.h" #include "../api/Texture.h" #include "../util/Log.h" diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index afd71fe..d24a33d 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -1,14 +1,15 @@ -#include "../ComponentManager.h" +#include "../manager/ComponentManager.h" +#include "../manager/EventManager.h" #include "../api/Button.h" -#include "../api/EventManager.h" + #include "InputSystem.h" using namespace crepe; void InputSystem::update() { - ComponentManager & mgr = this->component_manager; - EventManager & event_mgr = EventManager::get_instance(); + ComponentManager& mgr = this->mediator.component_manager; + EventManager & event_mgr = this->mediator.event_manager; 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>(); @@ -118,7 +119,7 @@ void InputSystem::update() { } void InputSystem::handle_move(const SDLContext::EventData & event_data, const int world_mouse_x, const int world_mouse_y) { - ComponentManager & mgr = this->component_manager; + ComponentManager& mgr = this->mediator.component_manager; RefVector<Button> buttons = mgr.get_components_by_type<Button>(); @@ -146,7 +147,7 @@ void InputSystem::handle_move(const SDLContext::EventData & event_data, void InputSystem::handle_click(const MouseButton & mouse_button, const int world_mouse_x, const int world_mouse_y) { - ComponentManager & mgr = this->component_manager; + ComponentManager& mgr = this->mediator.component_manager; RefVector<Button> buttons = mgr.get_components_by_type<Button>(); diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h index eafeb91..0c42bd6 100644 --- a/src/crepe/system/InputSystem.h +++ b/src/crepe/system/InputSystem.h @@ -31,8 +31,7 @@ public: private: //! Stores the last position of the mouse when the button was pressed. - ivec2 last_mouse_down_position{std::numeric_limits<int>::max(), - std::numeric_limits<int>::max()}; + ivec2 last_mouse_down_position; //! Stores the last mouse button pressed. MouseButton last_mouse_button = MouseButton::NONE; |