diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index af1ea8b9d2..dcb1ab5a3d 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -985,7 +985,7 @@ static void InputWidgetOverFlatbuttonInvalidate() WindowBase* w = WindowFindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number); if (w != nullptr) { - WindowEventInvalidateCall(w); + WindowEventOnPrepareDrawCall(w); if (w->widgets[gHoverWidget.widget_index].type == WindowWidgetType::FlatBtn) { WidgetInvalidateByNumber(gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index); diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index ac979cd5a5..6fd4270484 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -726,7 +726,7 @@ static void WidgetScrollDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg // Draw the scroll contents if (scroll_dpi.width > 0 && scroll_dpi.height > 0) - WindowEventScrollPaintCall(&w, scroll_dpi, scrollIndex); + WindowEventScrollDrawCall(&w, scroll_dpi, scrollIndex); } static void WidgetHScrollbarDraw( diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 99d4e9f828..64c5d0a7ab 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -742,7 +742,7 @@ namespace OpenRCT2::Ui::Windows Invalidate(); WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); WindowInitScrollWidgets(*this); Invalidate(); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 8cd7f76716..9cb073e930 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -467,7 +467,7 @@ public: height = WH_OTHER_TABS; } WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); WindowInitScrollWidgets(*this); diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index f6c3277cf1..d7012d934f 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -213,7 +213,7 @@ void MultiplayerWindow::SetPage(int32_t page_number) widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); InitScrollWidgets(); Invalidate(); } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index f419c07d69..0aca909510 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2052,7 +2052,7 @@ private: Invalidate(); WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); InitScrollWidgets(); Invalidate(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 8f19966eeb..9f739019ca 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -632,7 +632,7 @@ private: } // Call invalidate event - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); focus = newFocus; @@ -1193,7 +1193,7 @@ private: Invalidate(); WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); WindowEventUpdateCall(this); if (listen && viewport != nullptr) viewport->flags |= VIEWPORT_FLAG_SOUND_ON; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 00fd810b0d..f7b246a7ef 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -304,7 +304,7 @@ public: height = min_height; Invalidate(); // HACK: For some reason invalidate has not been called - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); ContentUpdateScroll(); } @@ -314,7 +314,7 @@ public: height = max_height; Invalidate(); // HACK: For some reason invalidate has not been called - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); ContentUpdateScroll(); } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index ed1d15f04f..7d6249b947 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1093,7 +1093,7 @@ private: Invalidate(); WindowEventResizeCall(this); - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); InitScrollWidgets(); ViewportInit(); Invalidate(); @@ -1156,7 +1156,7 @@ private: viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } - WindowEventInvalidateCall(this); + WindowEventOnPrepareDrawCall(this); focus = tempFocus; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index c8d92b8872..15d11e6680 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -152,7 +152,7 @@ void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const return; auto widget = &widgetWindow->widgets[widgetIndex]; - WindowEventInvalidateCall(widgetWindow); + WindowEventOnPrepareDrawCall(widgetWindow); OpenRCT2String result; if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING) diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8e29f6c081..f41c2152ec 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1429,7 +1429,7 @@ void Guest::CheckCantFindRide() if (w != nullptr) { - WindowEventInvalidateCall(w); + WindowEventOnPrepareDrawCall(w); } WindowInvalidateByNumber(WindowClass::Peep, Id); @@ -3112,7 +3112,7 @@ static void PeepLeavePark(Guest* peep) WindowBase* w = WindowFindByNumber(WindowClass::Peep, peep->Id); if (w != nullptr) - WindowEventInvalidateCall(w); + WindowEventOnPrepareDrawCall(w); WindowInvalidateByNumber(WindowClass::Peep, peep->Id); } diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index a409438715..7099288f74 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -564,7 +564,7 @@ void PeepWindowStateUpdate(Peep* peep) { WindowBase* w = WindowFindByNumber(WindowClass::Peep, peep->Id.ToUnderlying()); if (w != nullptr) - WindowEventInvalidateCall(w); + WindowEventOnPrepareDrawCall(w); if (peep->Is()) { diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index b0f6155d14..79cd088d9b 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -419,7 +419,7 @@ WindowBase* WindowFindFromPoint(const ScreenCoordsXY& screenCoords) WidgetIndex WindowFindWidgetFromPoint(WindowBase& w, const ScreenCoordsXY& screenCoords) { // Invalidate the window - WindowEventInvalidateCall(&w); + WindowEventOnPrepareDrawCall(&w); // Find the widget at point x, y WidgetIndex widget_index = -1; @@ -1233,7 +1233,7 @@ static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, in // Invalidate modifies the window colours so first get the correct // colour before setting the global variables for the string painting - WindowEventInvalidateCall(&w); + WindowEventOnPrepareDrawCall(&w); // Text colouring gCurrentWindowColours[0] = NOT_TRANSLUCENT(w.colours[0]); @@ -1241,7 +1241,7 @@ static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, in gCurrentWindowColours[2] = NOT_TRANSLUCENT(w.colours[2]); gCurrentWindowColours[3] = NOT_TRANSLUCENT(w.colours[3]); - WindowEventPaintCall(&w, copy); + WindowEventOnDrawCall(&w, copy); } /** @@ -1293,7 +1293,7 @@ void WindowResize(WindowBase& w, int32_t dw, int32_t dh) w.height = std::clamp(w.height + dh, w.min_height, w.max_height); WindowEventResizeCall(&w); - WindowEventInvalidateCall(&w); + WindowEventOnPrepareDrawCall(&w); // Update scroll widgets for (auto& scroll : w.scrolls) @@ -1507,17 +1507,17 @@ void WindowEventMovedCall(WindowBase* w, const ScreenCoordsXY& screenCoords) w->OnMoved(screenCoords); } -void WindowEventInvalidateCall(WindowBase* w) +void WindowEventOnPrepareDrawCall(WindowBase* w) { w->OnPrepareDraw(); } -void WindowEventPaintCall(WindowBase* w, DrawPixelInfo& dpi) +void WindowEventOnDrawCall(WindowBase* w, DrawPixelInfo& dpi) { w->OnDraw(dpi); } -void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex) +void WindowEventScrollDrawCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex) { w->OnScrollDraw(scrollIndex, dpi); } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 15f1afb123..7780147c53 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -634,9 +634,9 @@ void WindowEventScrollSelectCall(WindowBase* w, int32_t scrollIndex, int32_t scr OpenRCT2String WindowEventTooltipCall(WindowBase* w, const WidgetIndex widgetIndex, const StringId fallback); CursorID WindowEventCursorCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); void WindowEventMovedCall(WindowBase* w, const ScreenCoordsXY& screenCoords); -void WindowEventInvalidateCall(WindowBase* w); -void WindowEventPaintCall(WindowBase* w, DrawPixelInfo& dpi); -void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex); +void WindowEventOnPrepareDrawCall(WindowBase* w); +void WindowEventOnDrawCall(WindowBase* w, DrawPixelInfo& dpi); +void WindowEventScrollDrawCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex); void InvalidateAllWindowsAfterInput(); void TextinputCancel();