diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 0b047363f2..885463cc1f 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index d9a8ca5d6f..ff34e2358e 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -14,6 +14,7 @@ #include "windows/Window.h" #include +#include #include #include #include diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index eb8f71bc5c..38f03d0e4f 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 22ded78c94..612addf5fe 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "MouseInput.h" + #include "../UiStringIds.h" #include "../interface/ViewportInteraction.h" @@ -1106,8 +1108,6 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, WindowBase* w, W } } -#pragma endregion - /** * * rct2: 0x006ED833 @@ -1562,29 +1562,6 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr #pragma endregion -#pragma region Keyboard input - -/** - * - * rct2: 0x00406CD2 - */ -int32_t GetNextKey() -{ - uint8_t* keysPressed = const_cast(ContextGetKeysPressed()); - for (int32_t i = 0; i < 221; i++) - { - if (keysPressed[i]) - { - keysPressed[i] = 0; - return i; - } - } - - return 0; -} - -#pragma endregion - /** * * rct2: 0x006ED990 diff --git a/src/openrct2-ui/input/MouseInput.h b/src/openrct2-ui/input/MouseInput.h new file mode 100644 index 0000000000..9747f262d6 --- /dev/null +++ b/src/openrct2-ui/input/MouseInput.h @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include + +enum class MouseState : uint32_t +{ + Released, + LeftPress, + LeftRelease, + RightPress, + RightRelease +}; + +extern ScreenCoordsXY gInputDragLast; + +void InputWindowPositionBegin(WindowBase& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void GameHandleInput(); +void GameHandleEdgeScroll(); + +void StoreMouseInput(MouseState state, const ScreenCoordsXY& screenCoords); + +void InputScrollViewport(const ScreenCoordsXY& screenCoords); diff --git a/src/openrct2-ui/libopenrct2ui.vcxproj b/src/openrct2-ui/libopenrct2ui.vcxproj index 567cbcba21..aae2bd2717 100644 --- a/src/openrct2-ui/libopenrct2ui.vcxproj +++ b/src/openrct2-ui/libopenrct2ui.vcxproj @@ -64,6 +64,7 @@ + diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index d4e1980d51..ed17cf606f 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index db3adb7218..830b66a25b 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -9,6 +9,7 @@ #include "../interface/Viewport.h" +#include #include #include #include diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 373efd11a9..f034754ee2 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -6,9 +6,10 @@ * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "../interface/Viewport.h" +#include #include +#include #include #include #include diff --git a/src/openrct2/Input.h b/src/openrct2/Input.h index 3184c227f2..8be8c268ee 100644 --- a/src/openrct2/Input.h +++ b/src/openrct2/Input.h @@ -36,15 +36,6 @@ enum INPUT_FLAGS INPUT_FLAG_VIEWPORT_SCROLLING = (1 << 7) }; -enum class MouseState : uint32_t -{ - Released, - LeftPress, - LeftRelease, - RightPress, - RightRelease -}; - enum class InputState { Reset, @@ -68,8 +59,6 @@ enum PLACE_OBJECT_MODIFIER extern uint8_t gInputPlaceObjectModifier; -extern ScreenCoordsXY gInputDragLast; - extern WidgetRef gHoverWidget; extern WidgetRef gPressedWidget; @@ -82,15 +71,8 @@ extern InputState _inputState; extern uint8_t _inputFlags; extern uint32_t _tooltipNotShownTimeout; -void InputWindowPositionBegin(WindowBase& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); - void TitleHandleKeyboardInput(); -void GameHandleInput(); void GameHandleKeyboardInput(); -void GameHandleEdgeScroll(); -int32_t GetNextKey(); - -void StoreMouseInput(MouseState state, const ScreenCoordsXY& screenCoords); void InputSetFlag(INPUT_FLAGS flag, bool on); bool InputTestFlag(INPUT_FLAGS flag); @@ -104,5 +86,3 @@ InputState InputGetState(); void ResetTooltipNotShown(); void InputResetPlaceObjModifier(); - -void InputScrollViewport(const ScreenCoordsXY& screenCoords);