mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
Refactor window functions to take references 7
This commit is contained in:
@@ -459,12 +459,12 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
|
||||
|
||||
#pragma region Window positioning / resizing
|
||||
|
||||
void InputWindowPositionBegin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
void InputWindowPositionBegin(rct_window& w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
_inputState = InputState::PositioningWindow;
|
||||
gInputDragLast = screenCoords - w->windowPos;
|
||||
_dragWidget.window_classification = w->classification;
|
||||
_dragWidget.window_number = w->number;
|
||||
gInputDragLast = screenCoords - w.windowPos;
|
||||
_dragWidget.window_classification = w.classification;
|
||||
_dragWidget.window_number = w.number;
|
||||
_dragWidget.widget_index = widgetIndex;
|
||||
}
|
||||
|
||||
@@ -1048,7 +1048,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, r
|
||||
}
|
||||
break;
|
||||
case WindowWidgetType::Caption:
|
||||
InputWindowPositionBegin(w, widgetIndex, screenCoords);
|
||||
InputWindowPositionBegin(*w, widgetIndex, screenCoords);
|
||||
break;
|
||||
case WindowWidgetType::Scroll:
|
||||
InputScrollBegin(*w, widgetIndex, screenCoords);
|
||||
|
||||
@@ -665,7 +665,7 @@ public:
|
||||
width = stringWidth;
|
||||
Invalidate();
|
||||
|
||||
InputWindowPositionBegin(this, 0, gTooltipCursor);
|
||||
InputWindowPositionBegin(*this, 0, gTooltipCursor);
|
||||
}
|
||||
|
||||
const ResearchItem& GetItem() const
|
||||
|
||||
@@ -92,7 +92,7 @@ extern InputState _inputState;
|
||||
extern uint8_t _inputFlags;
|
||||
extern uint16_t _tooltipNotShownTicks;
|
||||
|
||||
void InputWindowPositionBegin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void InputWindowPositionBegin(rct_window& w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void title_handle_keyboard_input();
|
||||
void GameHandleInput();
|
||||
|
||||
Reference in New Issue
Block a user