diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 7d850b6428..a88922eb53 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -93,7 +93,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) Memory::Free(newText); console.RefreshCaret(_session.SelectionStart); - window_update_textbox(); + WindowUpdateTextbox(); } break; case SDL_KEYDOWN: @@ -126,7 +126,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) { Clear(); console.RefreshCaret(_session.SelectionStart); - window_update_textbox(); + WindowUpdateTextbox(); } switch (key) @@ -141,7 +141,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) Delete(); console.RefreshCaret(_session.SelectionStart); - window_update_textbox(); + WindowUpdateTextbox(); } break; case SDLK_HOME: @@ -160,11 +160,11 @@ void TextComposition::HandleMessage(const SDL_Event* e) _session.SelectionStart = startOffset; Delete(); console.RefreshCaret(_session.SelectionStart); - window_update_textbox(); + WindowUpdateTextbox(); break; } case SDLK_RETURN: - window_cancel_textbox(); + WindowCancelTextbox(); break; case SDLK_LEFT: CursorLeft(); @@ -187,7 +187,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) utf8* text = SDL_GetClipboardText(); Insert(text); SDL_free(text); - window_update_textbox(); + WindowUpdateTextbox(); } break; } diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index f06667c5b6..9127210d3e 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -548,7 +548,7 @@ public: if (abs(gesturePixels) > tolerance) { _gestureRadius = 0; - main_window_zoom(gesturePixels > 0, true); + MainWindowZoom(gesturePixels > 0, true); } } break; @@ -783,8 +783,8 @@ private: uint32_t flags = SDL_GetWindowFlags(_window); if ((flags & SDL_WINDOW_MINIMIZED) == 0) { - window_resize_gui(_width, _height); - window_relocate_windows(_width, _height); + WindowResizeGui(_width, _height); + WindowRelocateWindows(_width, _height); } GfxInvalidateScreen(); @@ -891,7 +891,7 @@ private: int16_t bottom, DrawWeatherFunc drawFunc) { rct_window* w{}; - auto itStart = window_get_iterator(original_w); + auto itStart = WindowGetIterator(original_w); for (auto it = std::next(itStart);; it++) { if (it == g_window_list.end()) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 6b3f8989e1..a3722e3cdc 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -314,14 +314,14 @@ public: case INTENT_ACTION_NEW_SCENERY: { // Check if window is already open - auto* window = window_bring_to_front_by_class(WindowClass::Scenery); + auto* window = WindowBringToFrontByClass(WindowClass::Scenery); if (window == nullptr) { - auto* tlbrWindow = window_find_by_class(WindowClass::TopToolbar); + auto* tlbrWindow = WindowFindByClass(WindowClass::TopToolbar); if (tlbrWindow != nullptr) { tlbrWindow->Invalidate(); - if (!tool_set(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow)) + if (!ToolSet(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow)) { input_set_flag(INPUT_FLAG_6, true); window = WindowSceneryOpen(); @@ -383,7 +383,7 @@ public: case INTENT_ACTION_REFRESH_RIDE_LIST: { - auto window = window_find_by_class(WindowClass::RideList); + auto window = WindowFindByClass(WindowClass::RideList); if (window != nullptr) { WindowRideListRefreshList(window); @@ -399,10 +399,10 @@ public: case INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS: { auto rideIndex = intent.GetUIntExtra(INTENT_EXTRA_RIDE_ID); - auto w = window_find_by_class(WindowClass::RideConstruction); + auto w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || w->number != rideIndex) { - window_close_construction_windows(); + WindowCloseConstructionWindows(); _currentRideIndex = RideId::FromUnderlying(rideIndex); OpenWindow(WindowClass::RideConstruction); } @@ -455,7 +455,7 @@ public: case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW: { auto vehicle = static_cast(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE)); - auto* w = window_find_by_number(WindowClass::Ride, vehicle->ride.ToUnderlying()); + auto* w = WindowFindByNumber(WindowClass::Ride, vehicle->ride.ToUnderlying()); if (w == nullptr) return; @@ -474,7 +474,7 @@ public: case INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE: { auto rideIndex = intent.GetUIntExtra(INTENT_EXTRA_RIDE_ID); - auto w = window_find_by_number(WindowClass::Ride, rideIndex); + auto w = WindowFindByNumber(WindowClass::Ride, rideIndex); if (w != nullptr) { if (w->page == 4) // WINDOW_RIDE_PAGE_COLOUR @@ -488,19 +488,19 @@ public: case INTENT_ACTION_UPDATE_CLIMATE: gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_CLIMATE; - window_invalidate_by_class(WindowClass::GuestList); + WindowInvalidateByClass(WindowClass::GuestList); break; case INTENT_ACTION_UPDATE_GUEST_COUNT: gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_PEEP_COUNT; - window_invalidate_by_class(WindowClass::GuestList); - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::GuestList); + WindowInvalidateByClass(WindowClass::ParkInformation); WindowGuestListRefreshList(); break; case INTENT_ACTION_UPDATE_PARK_RATING: gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_PARK_RATING; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); break; case INTENT_ACTION_UPDATE_DATE: @@ -508,7 +508,7 @@ public: break; case INTENT_ACTION_UPDATE_CASH: - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_MONEY; break; @@ -516,7 +516,7 @@ public: { uint8_t bannerIndex = static_cast(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX)); - rct_window* w = window_find_by_number(WindowClass::Banner, bannerIndex); + rct_window* w = WindowFindByNumber(WindowClass::Banner, bannerIndex); if (w != nullptr) { w->Invalidate(); @@ -524,8 +524,8 @@ public: break; } case INTENT_ACTION_UPDATE_RESEARCH: - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::Research); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Research); break; case INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL: @@ -589,10 +589,10 @@ public: void SetMainView(const ScreenCoordsXY& viewPos, ZoomLevel zoom, int32_t rotation) override { - auto mainWindow = window_get_main(); + auto mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - auto viewport = window_get_viewport(mainWindow); + auto viewport = WindowGetViewport(mainWindow); auto zoomDifference = zoom - viewport->zoom; mainWindow->viewport_target_sprite = EntityId::GetNull(); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index b805a4de01..57543901ac 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -325,8 +325,8 @@ public: { _drawingContext->CalculcateClipping(&_bitsDPI); - window_update_all_viewports(); - window_draw_all(&_bitsDPI, 0, 0, _width, _height); + WindowUpdateAllViewports(); + WindowDrawAll(&_bitsDPI, 0, 0, _width, _height); } void PaintWeather() override diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 7323f7624f..a5d6698bfc 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -112,10 +112,10 @@ void InputManager::HandleViewScrolling() return; // Shortcut scrolling - auto mainWindow = window_get_main(); + auto mainWindow = WindowGetMain(); if (mainWindow != nullptr && (_viewScroll.x != 0 || _viewScroll.y != 0)) { - window_unfollow_sprite(*mainWindow); + WindowUnfollowSprite(*mainWindow); } InputScrollViewport(_viewScroll); @@ -197,7 +197,7 @@ void InputManager::Process(const InputEvent& e) if (e.DeviceKind == InputDeviceKind::Keyboard) { - auto w = window_find_by_class(WindowClass::Textinput); + auto w = WindowFindByClass(WindowClass::Textinput); if (w != nullptr) { if (e.State == InputEventState::Release) @@ -386,7 +386,7 @@ bool InputManager::HasTextInputFocus() const if (gUsingWidgetTextBox || gChatOpen) return true; - auto w = window_find_by_class(WindowClass::Textinput); + auto w = WindowFindByClass(WindowClass::Textinput); if (w != nullptr) return true; diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 0c96236841..5f685ca244 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -103,7 +103,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr */ void GameHandleInput() { - window_visit_each([](rct_window* w) { window_event_periodic_update_call(w); }); + WindowVisitEach([](rct_window* w) { WindowEventPeriodicUpdateCall(w); }); InvalidateAllWindowsAfterInput(); @@ -180,7 +180,7 @@ static void InputScrollDragBegin(const ScreenCoordsXY& screenCoords, rct_window* _dragWidget.widget_index = widgetIndex; _ticksSinceDragStart = 0; - _dragScrollIndex = window_get_scroll_data_index(*w, widgetIndex); + _dragScrollIndex = WindowGetScrollDataIndex(*w, widgetIndex); ContextHideCursor(); } @@ -217,7 +217,7 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind } WidgetScrollUpdateThumbs(*w, widgetIndex); - window_invalidate_by_number(w->classification, w->number); + WindowInvalidateByNumber(w->classification, w->number); ScreenCoordsXY fixedCursorPosition = { static_cast(std::ceil(gInputDragLast.x * gConfigGeneral.WindowScale)), static_cast(std::ceil(gInputDragLast.y * gConfigGeneral.WindowScale)) }; @@ -231,7 +231,7 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind */ static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState state) { - rct_window* w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); + rct_window* w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { ContextShowCursor(); @@ -272,8 +272,8 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState WidgetIndex widgetIndex; // Get window and widget under cursor position - w = window_find_from_point(screenCoords); - widgetIndex = w == nullptr ? -1 : window_find_widget_from_point(*w, screenCoords); + w = WindowFindFromPoint(screenCoords); + widgetIndex = w == nullptr ? -1 : WindowFindWidgetFromPoint(*w, screenCoords); widget = widgetIndex == -1 ? nullptr : &w->widgets[widgetIndex]; switch (_inputState) @@ -291,11 +291,11 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState InputWidgetLeft(screenCoords, w, widgetIndex); break; case MouseState::RightPress: - window_close_by_class(WindowClass::Tooltip); + WindowCloseByClass(WindowClass::Tooltip); if (w != nullptr) { - w = window_bring_to_front(*w); + w = WindowBringToFront(*w); } if (widgetIndex != -1) @@ -326,7 +326,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; case InputState::PositioningWindow: - w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); + w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { _inputState = InputState::Reset; @@ -359,7 +359,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; case InputState::ViewportLeft: - w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); + w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { _inputState = InputState::Reset; @@ -384,13 +384,13 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState break; } - w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w == nullptr) { break; } - window_event_tool_drag_call(w, gCurrentToolWidget.widget_index, screenCoords); + WindowEventToolDragCall(w, gCurrentToolWidget.widget_index, screenCoords); break; case MouseState::LeftRelease: _inputState = InputState::Reset; @@ -398,11 +398,10 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState { if ((_inputFlags & INPUT_FLAG_TOOL_ACTIVE)) { - w = window_find_by_number( - gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) { - window_event_tool_up_call(w, gCurrentToolWidget.widget_index, screenCoords); + WindowEventToolUpCall(w, gCurrentToolWidget.widget_index, screenCoords); } } else if (!(_inputFlags & INPUT_FLAG_4)) @@ -435,7 +434,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState } break; case InputState::Resizing: - w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); + w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { _inputState = InputState::Reset; @@ -475,7 +474,7 @@ static void InputWindowPositionContinue( int32_t snapProximity; snapProximity = (w.flags & WF_NO_SNAPPING) ? 0 : gConfigGeneral.WindowSnapProximity; - window_move_and_snap(w, newScreenCoords - lastScreenCoords, snapProximity); + WindowMoveAndSnap(w, newScreenCoords - lastScreenCoords, snapProximity); } static void InputWindowPositionEnd(rct_window& w, const ScreenCoordsXY& screenCoords) @@ -483,7 +482,7 @@ static void InputWindowPositionEnd(rct_window& w, const ScreenCoordsXY& screenCo _inputState = InputState::Normal; gTooltipTimeout = 0; gTooltipWidget = _dragWidget; - window_event_moved_call(&w, screenCoords); + WindowEventMovedCall(&w, screenCoords); } static void InputWindowResizeBegin(rct_window& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) @@ -505,7 +504,7 @@ static void InputWindowResizeContinue(rct_window& w, const ScreenCoordsXY& scree int32_t targetWidth = _originalWindowWidth + differentialCoords.x - w.width; int32_t targetHeight = _originalWindowHeight + differentialCoords.y - w.height; - window_resize(w, targetWidth, targetHeight); + WindowResize(w, targetWidth, targetHeight); } } @@ -534,7 +533,7 @@ static void InputViewportDragBegin(rct_window& w) ContextHideCursor(); } - window_unfollow_sprite(w); + WindowUnfollowSprite(w); // gInputFlags |= INPUT_FLAG_5; } @@ -547,7 +546,7 @@ static void InputViewportDragContinue() const CursorState* cursorState = ContextGetCursorState(); auto differentialCoords = newDragCoords - gInputDragLast; - w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); + w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number); // #3294: Window can be closed during a drag session, so just finish // the session if the window no longer exists @@ -624,10 +623,10 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree _currentScrollArea = scroll_area; _currentScrollIndex = scroll_id; - window_event_scroll_select_call(&w, scroll_id, scroll_area); + WindowEventScrollSelectCall(&w, scroll_id, scroll_area); if (scroll_area == SCROLL_PART_VIEW) { - window_event_scroll_mousedown_call(&w, scroll_id, scrollCoords); + WindowEventScrollMousedownCall(&w, scroll_id, scrollCoords); return; } @@ -674,7 +673,7 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree break; } WidgetScrollUpdateThumbs(w, widgetIndex); - window_invalidate_by_number(w.classification, w.number); + WindowInvalidateByNumber(w.classification, w.number); } static void InputScrollContinue(rct_window& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) @@ -717,7 +716,7 @@ static void InputScrollContinue(rct_window& w, WidgetIndex widgetIndex, const Sc switch (scroll_part) { case SCROLL_PART_VIEW: - window_event_scroll_mousedrag_call(&w, scroll_id, newScreenCoords); + WindowEventScrollMousedragCall(&w, scroll_id, newScreenCoords); break; case SCROLL_PART_HSCROLLBAR_LEFT: InputScrollPartUpdateHLeft(w, widgetIndex, scroll_id); @@ -749,7 +748,7 @@ static void InputScrollPartUpdateHThumb(rct_window& w, WidgetIndex widgetIndex, const auto& widget = w.widgets[widgetIndex]; auto& scroll = w.scrolls[scroll_id]; - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { int32_t newLeft; newLeft = scroll.h_right; @@ -775,7 +774,7 @@ static void InputScrollPartUpdateHThumb(rct_window& w, WidgetIndex widgetIndex, newLeft = x; scroll.h_left = newLeft; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -788,7 +787,7 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex, const auto& widget = w.widgets[widgetIndex]; auto& scroll = w.scrolls[scroll_id]; - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { int32_t newTop; newTop = scroll.v_bottom; @@ -814,7 +813,7 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex, newTop = y; scroll.v_top = newTop; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -824,14 +823,14 @@ static void InputScrollPartUpdateVThumb(rct_window& w, WidgetIndex widgetIndex, */ static void InputScrollPartUpdateHLeft(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id) { - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; scroll.flags |= HSCROLLBAR_LEFT_PRESSED; if (scroll.h_left >= 3) scroll.h_left -= 3; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -842,7 +841,7 @@ static void InputScrollPartUpdateHLeft(rct_window& w, WidgetIndex widgetIndex, i static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id) { const auto& widget = w.widgets[widgetIndex]; - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; scroll.flags |= HSCROLLBAR_RIGHT_PRESSED; @@ -857,7 +856,7 @@ static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex, if (scroll.h_left > newLeft) scroll.h_left = newLeft; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -867,14 +866,14 @@ static void InputScrollPartUpdateHRight(rct_window& w, WidgetIndex widgetIndex, */ static void InputScrollPartUpdateVTop(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id) { - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; scroll.flags |= VSCROLLBAR_UP_PRESSED; if (scroll.v_top >= 3) scroll.v_top -= 3; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -885,7 +884,7 @@ static void InputScrollPartUpdateVTop(rct_window& w, WidgetIndex widgetIndex, in static void InputScrollPartUpdateVBottom(rct_window& w, WidgetIndex widgetIndex, int32_t scroll_id) { const auto& widget = w.widgets[widgetIndex]; - if (window_find_by_number(w.classification, w.number) != nullptr) + if (WindowFindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; scroll.flags |= VSCROLLBAR_DOWN_PRESSED; @@ -900,7 +899,7 @@ static void InputScrollPartUpdateVBottom(rct_window& w, WidgetIndex widgetIndex, if (scroll.v_top > newTop) scroll.v_top = newTop; WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate_by_number(w.classification, w.number, widgetIndex); + WidgetInvalidateByNumber(w.classification, w.number, widgetIndex); } } @@ -937,7 +936,7 @@ static void InputWidgetOver(const ScreenCoordsXY& screenCoords, rct_window* w, W WindowTooltipClose(); else { - window_event_scroll_mouseover_call(w, scrollId, newScreenCoords); + WindowEventScrollMouseoverCall(w, scrollId, newScreenCoords); InputUpdateTooltip(w, widgetIndex, screenCoords); } } @@ -981,14 +980,13 @@ static void InputWidgetOverChangeCheck(WindowClass windowClass, rct_windownumber */ static void InputWidgetOverFlatbuttonInvalidate() { - rct_window* w = window_find_by_number(gHoverWidget.window_classification, gHoverWidget.window_number); + rct_window* w = WindowFindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number); if (w != nullptr) { - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); if (w->widgets[gHoverWidget.widget_index].type == WindowWidgetType::FlatBtn) { - widget_invalidate_by_number( - gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index); + WidgetInvalidateByNumber(gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index); } } } @@ -1008,22 +1006,22 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W windowNumber = w->number; } - window_close_by_class(WindowClass::Error); - window_close_by_class(WindowClass::Tooltip); + WindowCloseByClass(WindowClass::Error); + WindowCloseByClass(WindowClass::Tooltip); // Window might have changed position in the list, therefore find it again - w = window_find_by_number(windowClass, windowNumber); + w = WindowFindByNumber(windowClass, windowNumber); if (w == nullptr) return; - w = window_bring_to_front(*w); + w = WindowBringToFront(*w); if (widgetIndex == -1) return; if (windowClass != gCurrentTextBox.window.classification || windowNumber != gCurrentTextBox.window.number || widgetIndex != gCurrentTextBox.widget_index) { - window_cancel_textbox(); + WindowCancelTextbox(); } const auto& widget = w->widgets[widgetIndex]; @@ -1032,7 +1030,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W { case WindowWidgetType::Frame: case WindowWidgetType::Resize: - if (window_can_resize(*w) + if (WindowCanResize(*w) && (screenCoords.x >= w->windowPos.x + w->width - 19 && screenCoords.y >= w->windowPos.y + w->height - 19)) InputWindowResizeBegin(*w, widgetIndex, screenCoords); break; @@ -1043,11 +1041,11 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W _dragWidget.window_number = windowNumber; if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE) { - w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) { input_set_flag(INPUT_FLAG_4, true); - window_event_tool_down_call(w, gCurrentToolWidget.widget_index, screenCoords); + WindowEventToolDownCall(w, gCurrentToolWidget.widget_index, screenCoords); } } break; @@ -1090,8 +1088,8 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W _inputState = InputState::WidgetPressed; _clickRepeatTicks = 1; - widget_invalidate_by_number(windowClass, windowNumber, widgetIndex); - window_event_mouse_down_call(w, widgetIndex); + WidgetInvalidateByNumber(windowClass, windowNumber, widgetIndex); + WindowEventMouseDownCall(w, widgetIndex); } break; } @@ -1111,11 +1109,11 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords) auto ft = Formatter(); ft.Add(STR_NONE); SetMapTooltip(ft); - window = window_find_from_point(screenCoords); + window = WindowFindFromPoint(screenCoords); if (window != nullptr) { - WidgetIndex widgetId = window_find_widget_from_point(*window, screenCoords); + WidgetIndex widgetId = WindowFindWidgetFromPoint(*window, screenCoords); if (widgetId != -1) { switch (window->widgets[widgetId].type) @@ -1162,13 +1160,13 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords) break; } // Same as default but with scroll_x/y - cursorId = window_event_cursor_call(window, widgetId, scrollCoords); + cursorId = WindowEventCursorCall(window, widgetId, scrollCoords); if (cursorId == CursorID::Undefined) cursorId = CursorID::Arrow; break; } default: - cursorId = window_event_cursor_call(window, widgetId, screenCoords); + cursorId = WindowEventCursorCall(window, widgetId, screenCoords); if (cursorId == CursorID::Undefined) cursorId = CursorID::Arrow; break; @@ -1188,12 +1186,12 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords) { if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE) { - rct_window* w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + rct_window* w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w == nullptr) - tool_cancel(); + ToolCancel(); else if (input_get_state() != InputState::ViewportRight) - window_event_tool_update_call(w, gCurrentToolWidget.widget_index, screenCoords); + WindowEventToolUpdateCall(w, gCurrentToolWidget.widget_index, screenCoords); } } @@ -1210,7 +1208,7 @@ void InputStateWidgetPressed( cursor_w_number = gPressedWidget.window_number; WidgetIndex cursor_widgetIndex = gPressedWidget.widget_index; - rct_window* cursor_w = window_find_by_number(cursor_w_class, cursor_w_number); + rct_window* cursor_w = WindowFindByNumber(cursor_w_class, cursor_w_number); if (cursor_w == nullptr) { _inputState = InputState::Reset; @@ -1256,7 +1254,7 @@ void InputStateWidgetPressed( { if (WidgetIsHoldable(*w, widgetIndex)) { - window_event_mouse_down_call(w, widgetIndex); + WindowEventMouseDownCall(w, widgetIndex); } } } @@ -1266,13 +1264,13 @@ void InputStateWidgetPressed( if (_inputState == InputState::DropdownActive) { gDropdownHighlightedIndex = gDropdownDefaultIndex; - window_invalidate_by_class(WindowClass::Dropdown); + WindowInvalidateByClass(WindowClass::Dropdown); } return; } _inputFlags |= INPUT_FLAG_WIDGET_PRESSED; - widget_invalidate_by_number(cursor_w_class, cursor_w_number, widgetIndex); + WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, widgetIndex); return; case MouseState::LeftRelease: case MouseState::RightPress: @@ -1314,20 +1312,20 @@ void InputStateWidgetPressed( } } - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); if (dropdownCleanup) { // Update w as it will be invalid after closing the dropdown window - w = window_find_by_number(wClass, wNumber); + w = WindowFindByNumber(wClass, wNumber); } else { - cursor_w = window_find_by_number(cursor_w_class, cursor_w_number); + cursor_w = WindowFindByNumber(cursor_w_class, cursor_w_number); if (_inputFlags & INPUT_FLAG_WIDGET_PRESSED) { _inputFlags &= ~INPUT_FLAG_WIDGET_PRESSED; - widget_invalidate_by_number(cursor_w_class, cursor_w_number, cursor_widgetIndex); + WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, cursor_widgetIndex); } _inputState = InputState::Normal; @@ -1343,7 +1341,7 @@ void InputStateWidgetPressed( dropdown_index = gDropdownDefaultIndex; } } - window_event_dropdown_call(cursor_w, cursor_widgetIndex, dropdown_index); + WindowEventDropdownCall(cursor_w, cursor_widgetIndex, dropdown_index); } } } @@ -1374,8 +1372,8 @@ void InputStateWidgetPressed( if (WidgetIsDisabled(*w, widgetIndex)) break; - widget_invalidate_by_number(cursor_w_class, cursor_w_number, widgetIndex); - window_event_mouse_up_call(w, widgetIndex); + WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, widgetIndex); + WindowEventMouseUpCall(w, widgetIndex); return; default: @@ -1389,13 +1387,13 @@ void InputStateWidgetPressed( if (_inputFlags & INPUT_FLAG_WIDGET_PRESSED) { _inputFlags &= ~INPUT_FLAG_WIDGET_PRESSED; - widget_invalidate_by_number(cursor_w_class, cursor_w_number, cursor_widgetIndex); + WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, cursor_widgetIndex); } return; } gDropdownHighlightedIndex = -1; - window_invalidate_by_class(WindowClass::Dropdown); + WindowInvalidateByClass(WindowClass::Dropdown); if (w == nullptr) { return; @@ -1462,7 +1460,7 @@ void InputStateWidgetPressed( } gDropdownHighlightedIndex = dropdown_index; - window_invalidate_by_class(WindowClass::Dropdown); + WindowInvalidateByClass(WindowClass::Dropdown); } else { @@ -1502,7 +1500,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr gTooltipTimeout += gCurrentDeltaTime; if (gTooltipTimeout >= 8000) { - window_close_by_class(WindowClass::Tooltip); + WindowCloseByClass(WindowClass::Tooltip); } } } @@ -1552,12 +1550,12 @@ void SetCursor(CursorID cursor_id) */ void InvalidateScroll() { - rct_window* w = window_find_by_number(gPressedWidget.window_classification, gPressedWidget.window_number); + rct_window* w = WindowFindByNumber(gPressedWidget.window_classification, gPressedWidget.window_number); if (w != nullptr) { // Reset to basic scroll w->scrolls[_currentScrollIndex].flags &= 0xFF11; - window_invalidate_by_number(gPressedWidget.window_classification, gPressedWidget.window_number); + WindowInvalidateByNumber(gPressedWidget.window_classification, gPressedWidget.window_number); } } @@ -1586,7 +1584,7 @@ void GameHandleEdgeScroll() rct_window* mainWindow; int32_t scrollX, scrollY; - mainWindow = window_get_main(); + mainWindow = WindowGetMain(); if (mainWindow == nullptr) return; if ((mainWindow->flags & WF_NO_SCROLLING) || (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TITLE_DEMO))) @@ -1622,7 +1620,7 @@ bool InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER modifier) void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); rct_viewport* viewport = mainWindow->viewport; const int32_t speed = gConfigGeneral.EdgeScrollingSpeed; diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index 6fb85f22e8..3463edf5b4 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -173,7 +173,7 @@ void ShortcutManager::ProcessEvent(const InputEvent& e) shortcut->Current.push_back(std::move(shortcutInput.value())); } _pendingShortcutChange.clear(); - window_close_by_class(WindowClass::ChangeKeyboardShortcut); + WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); SaveUserBindings(); } } diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 6d5bf9925b..c76f1114bb 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -57,10 +57,10 @@ static void RotateCamera(int32_t direction) { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto window = window_get_main(); + auto window = WindowGetMain(); if (window != nullptr) { - window_rotate_camera(*window, direction); + WindowRotateCamera(*window, direction); } } } @@ -69,7 +69,7 @@ static void ToggleViewFlag(int32_t viewportFlag) { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto window = window_get_main(); + auto window = WindowGetMain(); if (window != nullptr) { window->viewport->flags ^= viewportFlag; @@ -84,60 +84,60 @@ static void ShortcutRotateConstructionObject() return; // Rotate scenery - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w != nullptr && !WidgetIsDisabled(*w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON) && w->widgets[WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); + WindowEventMouseUpCall(w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); return; } // Rotate construction track piece - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && !WidgetIsDisabled(*w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE) && w->widgets[WC_RIDE_CONSTRUCTION__WIDX_ROTATE].type != WindowWidgetType::Empty) { // Check if building a maze... if (w->widgets[WC_RIDE_CONSTRUCTION__WIDX_ROTATE].tooltip != STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP) { - window_event_mouse_up_call(w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE); + WindowEventMouseUpCall(w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE); return; } } // Rotate track design preview - w = window_find_by_class(WindowClass::TrackDesignList); + w = WindowFindByClass(WindowClass::TrackDesignList); if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE) && w->widgets[WC_TRACK_DESIGN_LIST__WIDX_ROTATE].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE); + WindowEventMouseUpCall(w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE); return; } // Rotate track design placement - w = window_find_by_class(WindowClass::TrackDesignPlace); + w = WindowFindByClass(WindowClass::TrackDesignPlace); if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE) && w->widgets[WC_TRACK_DESIGN_PLACE__WIDX_ROTATE].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE); + WindowEventMouseUpCall(w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE); return; } // Rotate park entrance - w = window_find_by_class(WindowClass::Map); + w = WindowFindByClass(WindowClass::Map); if (w != nullptr && !WidgetIsDisabled(*w, WC_MAP__WIDX_ROTATE_90) && w->widgets[WC_MAP__WIDX_ROTATE_90].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, WC_MAP__WIDX_ROTATE_90); + WindowEventMouseUpCall(w, WC_MAP__WIDX_ROTATE_90); return; } // Rotate selected element in tile inspector - w = window_find_by_class(WindowClass::TileInspector); + w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE) && w->widgets[WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE); + WindowEventMouseUpCall(w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE); return; } } @@ -146,12 +146,12 @@ static void ShortcutRemoveTopBottomToolbarToggle() { if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) { - if (window_find_by_class(WindowClass::TitleLogo) != nullptr) + if (WindowFindByClass(WindowClass::TitleLogo) != nullptr) { - window_close(*window_find_by_class(WindowClass::TitleLogo)); - window_close(*window_find_by_class(WindowClass::TitleOptions)); - window_close(*window_find_by_class(WindowClass::TitleMenu)); - window_close(*window_find_by_class(WindowClass::TitleExit)); + WindowClose(*WindowFindByClass(WindowClass::TitleLogo)); + WindowClose(*WindowFindByClass(WindowClass::TitleOptions)); + WindowClose(*WindowFindByClass(WindowClass::TitleMenu)); + WindowClose(*WindowFindByClass(WindowClass::TitleExit)); title_set_hide_version_info(true); } else @@ -161,11 +161,11 @@ static void ShortcutRemoveTopBottomToolbarToggle() } else { - if (window_find_by_class(WindowClass::TopToolbar) != nullptr) + if (WindowFindByClass(WindowClass::TopToolbar) != nullptr) { - window_close(*window_find_by_class(WindowClass::Dropdown)); - window_close(*window_find_by_class(WindowClass::TopToolbar)); - window_close(*window_find_by_class(WindowClass::BottomToolbar)); + WindowClose(*WindowFindByClass(WindowClass::Dropdown)); + WindowClose(*WindowFindByClass(WindowClass::TopToolbar)); + WindowClose(*WindowFindByClass(WindowClass::BottomToolbar)); } else { @@ -193,11 +193,11 @@ static void ShortcutAdjustLand() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - rct_window* window = window_find_by_class(WindowClass::TopToolbar); + rct_window* window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_LAND); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_LAND); } } } @@ -212,11 +212,11 @@ static void ShortcutAdjustWater() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - rct_window* window = window_find_by_class(WindowClass::TopToolbar); + rct_window* window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_WATER); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_WATER); } } } @@ -231,11 +231,11 @@ static void ShortcutBuildScenery() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - rct_window* window = window_find_by_class(WindowClass::TopToolbar); + rct_window* window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_SCENERY); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_SCENERY); } } } @@ -250,11 +250,11 @@ static void ShortcutBuildPaths() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - rct_window* window = window_find_by_class(WindowClass::TopToolbar); + rct_window* window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_PATH); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_PATH); } } } @@ -382,10 +382,10 @@ static void ShortcutOpenCheatWindow() return; // Check if window is already open - rct_window* window = window_find_by_class(WindowClass::Cheats); + rct_window* window = WindowFindByClass(WindowClass::Cheats); if (window != nullptr) { - window_close(*window); + WindowClose(*window); return; } ContextOpenWindow(WindowClass::Cheats); @@ -408,11 +408,11 @@ static void ShortcutClearScenery() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - rct_window* window = window_find_by_class(WindowClass::TopToolbar); + rct_window* window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY); } } } @@ -423,7 +423,7 @@ static void ShortcutQuickSaveGame() // Do a quick save in playing mode and a regular save in Scenario Editor mode. In other cases, don't do anything. if (gScreenFlags == SCREEN_FLAGS_PLAYING) { - tool_cancel(); + ToolCancel(); save_game(); } else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) @@ -450,23 +450,23 @@ static void ShortcutOpenSceneryPicker() || (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gEditorStep != EditorStep::LandscapeEditor)) return; - rct_window* window_scenery = window_find_by_class(WindowClass::Scenery); + rct_window* window_scenery = WindowFindByClass(WindowClass::Scenery); if (window_scenery == nullptr) { - rct_window* window_toolbar = window_find_by_class(WindowClass::TopToolbar); + rct_window* window_toolbar = WindowFindByClass(WindowClass::TopToolbar); if (window_toolbar != nullptr) { window_toolbar->Invalidate(); - window_event_mouse_up_call(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY); + WindowEventMouseUpCall(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY); } } - window_scenery = window_find_by_class(WindowClass::Scenery); + window_scenery = WindowFindByClass(WindowClass::Scenery); if (window_scenery != nullptr && !WidgetIsDisabled(*window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON) && window_scenery->widgets[WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON].type != WindowWidgetType::Empty && !gWindowSceneryEyedropperEnabled) { - window_event_mouse_up_call(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON); + WindowEventMouseUpCall(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON); return; } } @@ -493,19 +493,19 @@ static void ShortcutScaleDown() // Tile inspector shortcuts static void TileInspectorMouseUp(WidgetIndex widgetIndex) { - auto w = window_find_by_class(WindowClass::TileInspector); + auto w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { - window_event_mouse_up_call(w, widgetIndex); + WindowEventMouseUpCall(w, widgetIndex); } } static void TileInspectorMouseDown(WidgetIndex widgetIndex) { - auto w = window_find_by_class(WindowClass::TileInspector); + auto w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, widgetIndex); + WindowEventMouseDownCall(w, widgetIndex); } } @@ -515,7 +515,7 @@ static void ShortcutToggleVisibility() if (windowTileInspectorSelectedIndex < 0) return; - rct_window* w = window_find_by_class(WindowClass::TileInspector); + rct_window* w = WindowFindByClass(WindowClass::TileInspector); if (w == nullptr) return; @@ -530,7 +530,7 @@ static void ShortcutToggleVisibility() static void ShortcutIncreaseElementHeight() { - rct_window* w = window_find_by_class(WindowClass::TileInspector); + rct_window* w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr) { int action = -1; @@ -564,14 +564,14 @@ static void ShortcutIncreaseElementHeight() break; } if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty) - window_event_mouse_down_call(w, action); + WindowEventMouseDownCall(w, action); return; } } static void ShortcutDecreaseElementHeight() { - rct_window* w = window_find_by_class(WindowClass::TileInspector); + rct_window* w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr) { int action = -1; @@ -605,7 +605,7 @@ static void ShortcutDecreaseElementHeight() break; } if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty) - window_event_mouse_down_call(w, action); + WindowEventMouseDownCall(w, action); return; } } @@ -625,7 +625,7 @@ static void ShortcutToggleConsole() } else if (gConfigGeneral.DebuggingTools && !ContextIsInputActive()) { - window_cancel_textbox(); + WindowCancelTextbox(); console.Toggle(); } } @@ -635,14 +635,14 @@ static void ShortcutConstructionTurnLeft() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_turn_left(); + WindowFootpathKeyboardShortcutTurnLeft(); } else { - window_ride_construction_keyboard_shortcut_turn_left(); + WindowRideConstructionKeyboardShortcutTurnLeft(); } } @@ -650,14 +650,14 @@ static void ShortcutConstructionTurnRight() { if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_turn_right(); + WindowFootpathKeyboardShortcutTurnRight(); } else { - window_ride_construction_keyboard_shortcut_turn_right(); + WindowRideConstructionKeyboardShortcutTurnRight(); } } @@ -666,14 +666,14 @@ static void ShortcutConstructionSlopeUp() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_slope_up(); + WindowFootpathKeyboardShortcutSlopeUp(); } else { - window_ride_construction_keyboard_shortcut_slope_up(); + WindowRideConstructionKeyboardShortcutSlopeUp(); } } @@ -682,14 +682,14 @@ static void ShortcutConstructionBuildCurrent() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_build_current(); + WindowFootpathKeyboardShortcutBuildCurrent(); } else { - window_ride_construction_keyboard_shortcut_build_current(); + WindowRideConstructionKeyboardShortcutBuildCurrent(); } } @@ -698,14 +698,14 @@ static void ShortcutConstructionSlopeDown() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_slope_down(); + WindowFootpathKeyboardShortcutSlopeDown(); } else { - window_ride_construction_keyboard_shortcut_slope_down(); + WindowRideConstructionKeyboardShortcutSlopeDown(); } } @@ -714,14 +714,14 @@ static void ShortcutConstructionDemolishCurrent() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - rct_window* window = window_find_by_class(WindowClass::Footpath); + rct_window* window = WindowFindByClass(WindowClass::Footpath); if (window != nullptr) { - window_footpath_keyboard_shortcut_demolish_current(); + WindowFootpathKeyboardShortcutDemolishCurrent(); } else { - window_ride_construction_keyboard_shortcut_demolish_current(); + WindowRideConstructionKeyboardShortcutDemolishCurrent(); } } @@ -744,40 +744,40 @@ void ShortcutManager::RegisterDefaultShortcuts() // clang-format off // Interface - RegisterShortcut(ShortcutId::InterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", []() { window_close_top(); }); + RegisterShortcut(ShortcutId::InterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", []() { WindowCloseTop(); }); RegisterShortcut(ShortcutId::InterfaceCloseAll, STR_SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS, "SHIFT+BACKSPACE", []() { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)) { - window_close_all(); + WindowCloseAll(); } else if (gEditorStep == EditorStep::LandscapeEditor) { - window_close_top(); + WindowCloseTop(); } }); RegisterShortcut(ShortcutId::InterfaceRotateConstruction, STR_SHORTCUT_ROTATE_CONSTRUCTION_OBJECT, "Z", []() { ShortcutRotateConstructionObject(); }); RegisterShortcut(ShortcutId::InterfaceCancelConstruction, STR_SHORTCUT_CANCEL_CONSTRUCTION_MODE, "ESCAPE", []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto window = window_find_by_class(WindowClass::Error); + auto window = WindowFindByClass(WindowClass::Error); if (window != nullptr) { - window_close(*window); + WindowClose(*window); } else if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { - tool_cancel(); + ToolCancel(); } } }); RegisterShortcut(ShortcutId::InterfacePause, STR_SHORTCUT_PAUSE_GAME, "PAUSE", []() { if (!(gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))) { - auto window = window_find_by_class(WindowClass::TopToolbar); + auto window = WindowFindByClass(WindowClass::TopToolbar); if (window != nullptr) { window->Invalidate(); - window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_PAUSE); + WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_PAUSE); } } }); @@ -839,8 +839,8 @@ void ShortcutManager::RegisterDefaultShortcuts() }); // View - RegisterShortcut(ShortcutId::ViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", []() { main_window_zoom(false, false); }); - RegisterShortcut(ShortcutId::ViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", []() { main_window_zoom(true, false); }); + RegisterShortcut(ShortcutId::ViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", []() { MainWindowZoom(false, false); }); + RegisterShortcut(ShortcutId::ViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", []() { MainWindowZoom(true, false); }); RegisterShortcut(ShortcutId::ViewGeneralRotateClockwise, STR_SHORTCUT_ROTATE_VIEW_CLOCKWISE, "RETURN", "MOUSE 6", []() { RotateCamera(1); }); RegisterShortcut(ShortcutId::ViewGeneralRotateAnticlockwise, STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE, "SHIFT+RETURN", "MOUSE 5", []() { RotateCamera(-1); }); @@ -871,14 +871,14 @@ void ShortcutManager::RegisterDefaultShortcuts() // Window RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { ShortcutConstructionTurnLeft(); }); RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { ShortcutConstructionTurnRight(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { window_ride_construction_keyboard_shortcut_use_track_default(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { WindowRideConstructionKeyboardShortcutUseTrackDefault(); }); RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { ShortcutConstructionSlopeDown(); }); RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { ShortcutConstructionSlopeUp(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { window_ride_construction_keyboard_shortcut_chain_lift_toggle(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { window_ride_construction_keyboard_shortcut_bank_left(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { window_ride_construction_keyboard_shortcut_bank_right(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { window_ride_construction_keyboard_shortcut_previous_track(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { window_ride_construction_keyboard_shortcut_next_track(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { WindowRideConstructionKeyboardShortcutChainLiftToggle(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { WindowRideConstructionKeyboardShortcutBankLeft(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { WindowRideConstructionKeyboardShortcutBankRight(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { WindowRideConstructionKeyboardShortcutPreviousTrack(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { WindowRideConstructionKeyboardShortcutNextTrack(); }); RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); }); RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); }); @@ -906,10 +906,10 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::DebugTogglePaintDebugWindow, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto window = window_find_by_class(WindowClass::DebugPaint); + auto window = WindowFindByClass(WindowClass::DebugPaint); if (window != nullptr) { - window_close(*window); + WindowClose(*window); } else { diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 448b6a4261..90cc844b6b 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -248,10 +248,10 @@ void InGameConsole::Update() if (_isOpen) { // When scrolling the map, the console pixels get copied... therefore invalidate the screen - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - rct_viewport* mainViewport = window_get_viewport(mainWindow); + rct_viewport* mainViewport = WindowGetViewport(mainWindow); if (mainViewport != nullptr) { if (_lastMainViewport != mainViewport->viewPos) diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 1719e6dc09..336bb536c2 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -871,7 +871,7 @@ StringId ThemeDescGetName(WindowClass wc) void ColourSchemeUpdateAll() { - window_visit_each([](rct_window* w) { ColourSchemeUpdate(w); }); + WindowVisitEach([](rct_window* w) { ColourSchemeUpdate(w); }); } void ColourSchemeUpdate(rct_window* window) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index db82cf7276..eb23616468 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -446,8 +446,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (!(input_test_flag(INPUT_FLAG_6)) || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) { - if (window_find_by_class(WindowClass::RideConstruction) == nullptr - && window_find_by_class(WindowClass::Footpath) == nullptr) + if (WindowFindByClass(WindowClass::RideConstruction) == nullptr && WindowFindByClass(WindowClass::Footpath) == nullptr) { info.SpriteType = ViewportInteractionItem::None; return info; @@ -618,7 +617,7 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co auto z = tileElement->GetBaseZ(); - w = window_find_by_class(WindowClass::Footpath); + w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) FootpathProvisionalUpdate(); @@ -737,7 +736,7 @@ PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance) { - auto* w = window_find_from_point(screenCoords); + auto* w = WindowFindFromPoint(screenCoords); if (w == nullptr) return nullptr; @@ -761,7 +760,7 @@ static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int3 */ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords) { - rct_window* window = window_find_from_point(screenCoords); + rct_window* window = WindowFindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { CoordsXY ret{}; diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index da4951aa11..e0d13649fc 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -659,7 +659,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex widgetIndex) { // Get the widget - int32_t scrollIndex = window_get_scroll_data_index(w, widgetIndex); + int32_t scrollIndex = WindowGetScrollDataIndex(w, widgetIndex); const auto& widget = w.widgets[widgetIndex]; const auto& scroll = w.scrolls[scrollIndex]; @@ -721,7 +721,7 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex // Draw the scroll contents if (scroll_dpi.width > 0 && scroll_dpi.height > 0) - window_event_scroll_paint_call(&w, &scroll_dpi, scrollIndex); + WindowEventScrollPaintCall(&w, &scroll_dpi, scrollIndex); } static void WidgetHScrollbarDraw( diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 959b3d52dd..eedb72db16 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -224,7 +224,7 @@ rct_window* WindowCreate( { if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) { - window_close(*w.get()); + WindowClose(*w.get()); break; } } @@ -377,7 +377,7 @@ static void WindowScrollWheelInput(rct_window& w, int32_t scrollIndex, int32_t w } WidgetScrollUpdateThumbs(w, widgetIndex); - widget_invalidate(w, widgetIndex); + WidgetInvalidate(w, widgetIndex); } /** @@ -415,9 +415,9 @@ static void WindowViewportWheelInput(rct_window& w, int32_t wheel) return; if (wheel < 0) - window_zoom_in(w, true); + WindowZoomIn(w, true); else if (wheel > 0) - window_zoom_out(w, true); + WindowZoomOut(w, true); } static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_t wheel) @@ -500,7 +500,7 @@ static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_ return false; } - window_event_mouse_down_call(&w, buttonWidgetIndex); + WindowEventMouseDownCall(&w, buttonWidgetIndex); return true; } @@ -523,7 +523,7 @@ void WindowAllWheelInput() // Check window cursor is over if (!(input_test_flag(INPUT_FLAG_5))) { - rct_window* w = window_find_from_point(cursorState->position); + rct_window* w = WindowFindFromPoint(cursorState->position); if (w != nullptr) { // Check if main window @@ -534,7 +534,7 @@ void WindowAllWheelInput() } // Check scroll view, cursor is over - WidgetIndex widgetIndex = window_find_widget_from_point(*w, cursorState->position); + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*w, cursorState->position); if (widgetIndex != -1) { const auto& widget = w->widgets[widgetIndex]; @@ -593,7 +593,7 @@ void WindowInitScrollWidgets(rct_window& w) scroll.flags = 0; width = 0; height = 0; - window_get_scroll_size(&w, scroll_index, &width, &height); + WindowGetScrollSize(&w, scroll_index, &width, &height); scroll.h_left = 0; scroll.h_right = width + 1; scroll.v_top = 0; @@ -682,10 +682,10 @@ static void WindowInvalidatePressedImageButton(const rct_window& w) */ void InvalidateAllWindowsAfterInput() { - window_visit_each([](rct_window* w) { - window_update_scroll_widgets(*w); + WindowVisitEach([](rct_window* w) { + WindowUpdateScrollWidgets(*w); WindowInvalidatePressedImageButton(*w); - window_event_resize_call(w); + WindowEventResizeCall(w); }); } @@ -711,7 +711,7 @@ void Window::InitScrollWidgets() void Window::InvalidateWidget(WidgetIndex widgetIndex) { - widget_invalidate(*this, widgetIndex); + WidgetInvalidate(*this, widgetIndex); } bool Window::IsWidgetDisabled(WidgetIndex widgetIndex) const @@ -758,18 +758,18 @@ void Window::Close() } else { - window_close(*this); + WindowClose(*this); } } void Window::CloseOthers() { - window_close_all_except_number_and_class(number, classification); + WindowCloseAllExceptNumberAndClass(number, classification); } void Window::CloseOthersOfThisClass() { - window_close_by_class(classification); + WindowCloseByClass(classification); } CloseWindowModifier Window::GetCloseModifier() @@ -793,7 +793,7 @@ void Window::TextInputOpen( WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength); } -void window_align_tabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id) +void WindowAlignTabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id) { int32_t i, x = w->widgets[start_tab_id].left; int32_t tab_width = w->widgets[start_tab_id].width(); diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index 533668b5a7..5ad8d6ddef 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -37,4 +37,4 @@ struct Window : rct_window void WindowAllWheelInput(); void ApplyScreenSaverLockSetting(); -void window_align_tabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id); +void WindowAlignTabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id); diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 4ec6633678..4fb72e1511 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -255,7 +255,7 @@ void CustomListView::SetColumns(const std::vector& columns, bool SortItems(0, ColumnSortOrder::None); if (!initialising) { - window_update_scroll_widgets(*ParentWindow); + WindowUpdateScrollWidgets(*ParentWindow); Invalidate(); } } @@ -272,7 +272,7 @@ void CustomListView::SetItems(const std::vector& items, bool initi SortItems(0, ColumnSortOrder::None); if (!initialising) { - window_update_scroll_widgets(*ParentWindow); + WindowUpdateScrollWidgets(*ParentWindow); Invalidate(); } } @@ -283,7 +283,7 @@ void CustomListView::SetItems(std::vector&& items, bool initialisi SortItems(0, ColumnSortOrder::None); if (!initialising) { - window_update_scroll_widgets(*ParentWindow); + WindowUpdateScrollWidgets(*ParentWindow); Invalidate(); } } diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index a3ff9e754e..925021699b 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -110,7 +110,7 @@ namespace OpenRCT2::Scripting { if (ActiveCustomTool->Owner == owner) { - tool_cancel(); + ToolCancel(); } } @@ -261,14 +261,14 @@ namespace OpenRCT2::Scripting customTool.onUp = dukValue["onUp"]; customTool.onFinish = dukValue["onFinish"]; - auto toolbarWindow = window_find_by_class(WindowClass::TopToolbar); + auto toolbarWindow = WindowFindByClass(WindowClass::TopToolbar); if (toolbarWindow != nullptr) { // Use a widget that does not exist on top toolbar but also make sure it isn't -1 as that // prevents abort from being called. WidgetIndex widgetIndex = -2; - tool_cancel(); - tool_set(*toolbarWindow, widgetIndex, static_cast(customTool.Cursor)); + ToolCancel(); + ToolSet(*toolbarWindow, widgetIndex, static_cast(customTool.Cursor)); ActiveCustomTool = std::move(customTool); ActiveCustomTool->Start(); } diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index ee72858116..9b6aefd423 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -455,7 +455,7 @@ namespace OpenRCT2::Ui::Windows { frame_no = 0; } - widget_invalidate(*this, WIDX_TAB_0 + this->page); + WidgetInvalidate(*this, WIDX_TAB_0 + this->page); } } @@ -537,7 +537,7 @@ namespace OpenRCT2::Ui::Windows auto widgetIndex = GetViewportWidgetIndex(); if (WidgetIsVisible(*this, widgetIndex.value_or(false))) { - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); } } } @@ -576,7 +576,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; default: { @@ -664,7 +664,7 @@ namespace OpenRCT2::Ui::Windows else if (widgetDesc->Type == "textbox") { auto* text = const_cast(widgetDesc->Text.c_str()); - window_start_textbox(*this, widgetIndex, STR_STRING, text, widgetDesc->MaxLength + 1); + WindowStartTextbox(*this, widgetIndex, STR_STRING, text, widgetDesc->MaxLength + 1); } } } @@ -764,8 +764,8 @@ namespace OpenRCT2::Ui::Windows RefreshWidgets(); Invalidate(); - window_event_resize_call(this); - window_event_invalidate_call(this); + WindowEventResizeCall(this); + WindowEventInvalidateCall(this); WindowInitScrollWidgets(*this); Invalidate(); @@ -1114,7 +1114,7 @@ namespace OpenRCT2::Ui::Windows static rct_windownumber GetNewWindowNumber() { auto result = _nextWindowNumber++; - while (window_find_by_number(WindowClass::Custom, result) != nullptr) + while (WindowFindByNumber(WindowClass::Custom, result) != nullptr) { result++; } @@ -1204,7 +1204,7 @@ namespace OpenRCT2::Ui::Windows { customWidgetInfo->Text = value; w->widgets[widgetIndex].string = customWidgetInfo->Text.data(); - widget_invalidate(*w, widgetIndex); + WidgetInvalidate(*w, widgetIndex); } } } @@ -1238,7 +1238,7 @@ namespace OpenRCT2::Ui::Windows { customWidgetInfo->Colour = colour; widget.image = GetColourButtonImage(colour); - widget_invalidate(*w, widgetIndex); + WidgetInvalidate(*w, widgetIndex); std::vector args; auto ctx = customWidgetInfo->OnChange.context(); @@ -1283,7 +1283,7 @@ namespace OpenRCT2::Ui::Windows } customWidgetInfo->SelectedIndex = selectedIndex; - widget_invalidate(*w, widgetIndex); + WidgetInvalidate(*w, widgetIndex); if (lastSelectedIndex != selectedIndex) { @@ -1434,7 +1434,7 @@ namespace OpenRCT2::Ui::Windows if (w->custom_info != nullptr) { auto& info = GetInfo(w); - auto scrollIndex = window_get_scroll_data_index(*w, widgetIndex); + auto scrollIndex = WindowGetScrollDataIndex(*w, widgetIndex); if (scrollIndex < static_cast(info.ListViews.size())) { return &info.ListViews[scrollIndex]; @@ -1489,7 +1489,7 @@ namespace OpenRCT2::Ui::Windows for (auto& window : customWindows) { - window_close(*window.get()); + WindowClose(*window.get()); } } diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 6f6504aa9e..8287d4e0ed 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -110,7 +110,7 @@ namespace OpenRCT2::Scripting void cancel() { - tool_cancel(); + ToolCancel(); } }; @@ -188,18 +188,18 @@ namespace OpenRCT2::Scripting { if (id.type() == DukValue::Type::NUMBER) { - window_close_by_number(cls, id.as_int()); + WindowCloseByNumber(cls, id.as_int()); } else { - window_close_by_class(cls); + WindowCloseByClass(cls); } } } void closeAllWindows() { - window_close_all(); + WindowCloseAll(); } std::shared_ptr getWindow(DukValue a) const diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 4f484b8c22..edf04c9192 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -122,7 +122,7 @@ namespace OpenRCT2::Scripting { while (get_current_rotation() != value) { - window_rotate_camera(*w, 1); + WindowRotateCamera(*w, 1); } } } @@ -143,7 +143,7 @@ namespace OpenRCT2::Scripting if (w != nullptr) { auto i8Value = static_cast(value); - window_zoom_set(*w, ZoomLevel{ i8Value }, false); + WindowZoomSet(*w, ZoomLevel{ i8Value }, false); } } @@ -220,7 +220,7 @@ namespace OpenRCT2::Scripting auto coords = GetCoordsFromObject(position); if (coords) { - window_scroll_to_location(*w, *coords); + WindowScrollToLocation(*w, *coords); } } } @@ -245,9 +245,9 @@ namespace OpenRCT2::Scripting rct_window* GetWindow() const { if (_class == WindowClass::MainWindow) - return window_get_main(); + return WindowGetMain(); - return window_find_by_number(_class, _number); + return WindowFindByNumber(_class, _number); } rct_viewport* GetViewport() const diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 78dfd37624..51d3f6fa57 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -146,19 +146,19 @@ namespace OpenRCT2::Scripting auto buttonWidget = widget + 1; buttonWidget->left += delta; buttonWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); } else if (widget->type == WindowWidgetType::Spinner) { auto upWidget = widget + 1; upWidget->left += delta; upWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); auto downWidget = widget + 2; downWidget->left += delta; downWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 2); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2); } Invalidate(); @@ -190,19 +190,19 @@ namespace OpenRCT2::Scripting auto buttonWidget = widget + 1; buttonWidget->top += delta; buttonWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); } else if (widget->type == WindowWidgetType::Spinner) { auto upWidget = widget + 1; upWidget->top += delta; upWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); auto downWidget = widget + 2; downWidget->top += delta; downWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 2); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2); } Invalidate(); @@ -233,19 +233,19 @@ namespace OpenRCT2::Scripting auto buttonWidget = widget + 1; buttonWidget->left += delta; buttonWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); } else if (widget->type == WindowWidgetType::Spinner) { auto upWidget = widget + 1; upWidget->left += delta; upWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); auto downWidget = widget + 2; downWidget->left += delta; downWidget->right += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 2); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2); } Invalidate(); @@ -275,17 +275,17 @@ namespace OpenRCT2::Scripting { auto buttonWidget = widget + 1; buttonWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); } else if (widget->type == WindowWidgetType::Spinner) { auto upWidget = widget + 1; upWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 1); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 1); auto downWidget = widget + 2; downWidget->bottom += delta; - widget_invalidate_by_number(_class, _number, _widgetIndex + 2); + WidgetInvalidateByNumber(_class, _number, _widgetIndex + 2); } Invalidate(); @@ -404,9 +404,9 @@ namespace OpenRCT2::Scripting rct_window* GetWindow() const { if (_class == WindowClass::MainWindow) - return window_get_main(); + return WindowGetMain(); - return window_find_by_number(_class, _number); + return WindowFindByNumber(_class, _number); } Widget* GetWidget() const @@ -431,7 +431,7 @@ namespace OpenRCT2::Scripting void Invalidate() { - widget_invalidate_by_number(_class, _number, _widgetIndex); + WidgetInvalidateByNumber(_class, _number, _widgetIndex); } }; diff --git a/src/openrct2-ui/scripting/ScWindow.hpp b/src/openrct2-ui/scripting/ScWindow.hpp index 3555d5061c..95f5231d3f 100644 --- a/src/openrct2-ui/scripting/ScWindow.hpp +++ b/src/openrct2-ui/scripting/ScWindow.hpp @@ -65,7 +65,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_position(*w, { value, w->windowPos.y }); + WindowSetPosition(*w, { value, w->windowPos.y }); } } int32_t y_get() const @@ -82,7 +82,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_position(*w, { w->windowPos.x, value }); + WindowSetPosition(*w, { w->windowPos.x, value }); } } int32_t width_get() const @@ -99,13 +99,13 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - if (window_can_resize(*w)) + if (WindowCanResize(*w)) { - window_resize(*w, value - w->width, 0); + WindowResize(*w, value - w->width, 0); } else { - window_set_resize(*w, value, w->min_height, value, w->max_height); + WindowSetResize(*w, value, w->min_height, value, w->max_height); } } } @@ -123,13 +123,13 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - if (window_can_resize(*w)) + if (WindowCanResize(*w)) { - window_resize(*w, 0, value - w->height); + WindowResize(*w, 0, value - w->height); } else { - window_set_resize(*w, w->min_width, value, w->max_width, value); + WindowSetResize(*w, w->min_width, value, w->max_width, value); } } } @@ -147,7 +147,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_resize(*w, value, w->min_height, w->max_width, w->max_height); + WindowSetResize(*w, value, w->min_height, w->max_width, w->max_height); } } int32_t maxWidth_get() const @@ -164,7 +164,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_resize(*w, w->min_width, w->min_height, value, w->max_height); + WindowSetResize(*w, w->min_width, w->min_height, value, w->max_height); } } int32_t minHeight_get() const @@ -181,7 +181,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_resize(*w, w->min_width, value, w->max_width, w->max_height); + WindowSetResize(*w, w->min_width, value, w->max_width, w->max_height); } } int32_t maxHeight_get() const @@ -198,7 +198,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_set_resize(*w, w->min_width, w->min_height, w->max_width, value); + WindowSetResize(*w, w->min_width, w->min_height, w->max_width, value); } } bool isSticky_get() const @@ -305,7 +305,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_close(*w); + WindowClose(*w); } } @@ -329,7 +329,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - window_bring_to_front(*w); + WindowBringToFront(*w); w->flags |= WF_WHITE_BORDER_MASK; } } @@ -360,7 +360,7 @@ namespace OpenRCT2::Scripting private: rct_window* GetWindow() const { - return window_find_by_number(_class, _number); + return WindowFindByNumber(_class, _number); } }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 0f3e0883a6..9dd2b84c80 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -352,26 +352,26 @@ namespace OpenRCT2::Title void CloseParkSpecificWindows() { - window_close_by_class(WindowClass::ConstructRide); - window_close_by_class(WindowClass::DemolishRidePrompt); - window_close_by_class(WindowClass::EditorInventionListDrag); - window_close_by_class(WindowClass::EditorInventionList); - window_close_by_class(WindowClass::EditorObjectSelection); - window_close_by_class(WindowClass::EditorObjectiveOptions); - window_close_by_class(WindowClass::EditorScenarioOptions); - window_close_by_class(WindowClass::Finances); - window_close_by_class(WindowClass::FirePrompt); - window_close_by_class(WindowClass::GuestList); - window_close_by_class(WindowClass::InstallTrack); - window_close_by_class(WindowClass::Peep); - window_close_by_class(WindowClass::Ride); - window_close_by_class(WindowClass::RideConstruction); - window_close_by_class(WindowClass::RideList); - window_close_by_class(WindowClass::Scenery); - window_close_by_class(WindowClass::Staff); - window_close_by_class(WindowClass::TrackDeletePrompt); - window_close_by_class(WindowClass::TrackDesignList); - window_close_by_class(WindowClass::TrackDesignPlace); + WindowCloseByClass(WindowClass::ConstructRide); + WindowCloseByClass(WindowClass::DemolishRidePrompt); + WindowCloseByClass(WindowClass::EditorInventionListDrag); + WindowCloseByClass(WindowClass::EditorInventionList); + WindowCloseByClass(WindowClass::EditorObjectSelection); + WindowCloseByClass(WindowClass::EditorObjectiveOptions); + WindowCloseByClass(WindowClass::EditorScenarioOptions); + WindowCloseByClass(WindowClass::Finances); + WindowCloseByClass(WindowClass::FirePrompt); + WindowCloseByClass(WindowClass::GuestList); + WindowCloseByClass(WindowClass::InstallTrack); + WindowCloseByClass(WindowClass::Peep); + WindowCloseByClass(WindowClass::Ride); + WindowCloseByClass(WindowClass::RideConstruction); + WindowCloseByClass(WindowClass::RideList); + WindowCloseByClass(WindowClass::Scenery); + WindowCloseByClass(WindowClass::Staff); + WindowCloseByClass(WindowClass::TrackDeletePrompt); + WindowCloseByClass(WindowClass::TrackDesignList); + WindowCloseByClass(WindowClass::TrackDesignPlace); } void PrepareParkForPlayback() @@ -392,7 +392,7 @@ namespace OpenRCT2::Title void StoreCurrentViewLocation() { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr && w->viewport_smart_follow_sprite.IsNull()) { _previousWindowWidth = w->width; @@ -406,7 +406,7 @@ namespace OpenRCT2::Title */ void RestoreViewLocationIfResized() { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr && w->viewport_smart_follow_sprite.IsNull()) { if (w->width != _previousWindowWidth || w->height != _previousWindowHeight) diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index e6fa4dbbe4..4c9b20db94 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -206,7 +206,7 @@ public: break; case WIDX_BANNER_NO_ENTRY: { - textinput_cancel(); + TextinputCancel(); auto bannerSetStyle = BannerSetStyleAction( BannerSetStyleType::NoEntry, GetBannerIndex(), banner->flags ^ BANNER_FLAG_NO_ENTRY); GameActions::Execute(&bannerSetStyle); @@ -260,7 +260,7 @@ public: if (viewport != nullptr) { - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); } } @@ -300,7 +300,7 @@ public: */ rct_window* WindowBannerOpen(rct_windownumber number) { - auto w = static_cast(window_bring_to_front_by_number(WindowClass::Banner, number)); + auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index d6b0a1f57e..b11f8911b9 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -314,7 +314,7 @@ private: rct_window* WindowChangelogOpen(int personality) { - auto* window = window_bring_to_front_by_class(WindowClass::Changelog); + auto* window = WindowBringToFrontByClass(WindowClass::Changelog); if (window == nullptr) { // Create a new centred window diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index fc84827141..86b1c286ea 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -750,14 +750,14 @@ private: { auto setDateAction = ParkSetDateAction(_yearSpinnerValue, _monthSpinnerValue, _daySpinnerValue); GameActions::Execute(&setDateAction); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::BottomToolbar); break; } case WIDX_DATE_RESET: { auto setDateAction = ParkSetDateAction(1, 1, 1); GameActions::Execute(&setDateAction); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::BottomToolbar); InvalidateWidget(WIDX_YEAR_BOX); InvalidateWidget(WIDX_MONTH_BOX); InvalidateWidget(WIDX_DAY_BOX); @@ -1113,7 +1113,7 @@ private: rct_window* WindowCheatsOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::Cheats); + auto* window = WindowBringToFrontByClass(WindowClass::Cheats); if (window == nullptr) { window = WindowCreate(WindowClass::Cheats, ScreenCoordsXY(32, 32), WW, WH); diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index cd5d8c4e3b..10ff5bc17e 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -66,7 +66,7 @@ public: widgets = window_clear_scenery_widgets; hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); gLandToolSize = 2; gClearSceneryCost = MONEY64_UNDEFINED; @@ -81,7 +81,7 @@ public: void OnClose() override { if (ClearSceneryToolIsActive()) - tool_cancel(); + ToolCancel(); } void OnMouseUp(const WidgetIndex widgetIndex) override @@ -199,7 +199,7 @@ public: rct_window* WindowClearSceneryOpen() { - auto* w = static_cast(window_bring_to_front_by_class(WindowClass::ClearScenery)); + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::ClearScenery)); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 04f60a3407..078c67c0b9 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -72,7 +72,7 @@ public: CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1; gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; ConfigSaveDefault(); - window_invalidate_all(); + WindowInvalidateAll(); break; case WIDX_RATE_DOWN: if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1) @@ -80,7 +80,7 @@ public: CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1; gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; ConfigSaveDefault(); - window_invalidate_all(); + WindowInvalidateAll(); } break; case WIDX_AFFIX_DROPDOWN_BUTTON: @@ -146,7 +146,7 @@ public: gConfigGeneral.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; ConfigSaveDefault(); - window_invalidate_all(); + WindowInvalidateAll(); } } @@ -167,7 +167,7 @@ public: gConfigGeneral.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode; ConfigSaveDefault(); - window_invalidate_all(); + WindowInvalidateAll(); break; case WIDX_RATE: @@ -178,7 +178,7 @@ public: CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate; gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; ConfigSaveDefault(); - window_invalidate_all(); + WindowInvalidateAll(); } break; } diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 3218d8ee87..90d19aa081 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -55,7 +55,7 @@ public: widgets = window_debug_paint_widgets; InitScrollWidgets(); - window_push_others_below(*this); + WindowPushOthersBelow(*this); colours[0] = TRANSLUCENT(COLOUR_BLACK); colours[1] = COLOUR_GREY; diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 1e13eee9e9..825e92e1bd 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -97,11 +97,11 @@ rct_window* WindowRideDemolishPromptOpen(const Ride& ride) rct_window* w; DemolishRidePromptWindow* newWindow; - w = window_find_by_class(WindowClass::DemolishRidePrompt); + w = WindowFindByClass(WindowClass::DemolishRidePrompt); if (w != nullptr) { auto windowPos = w->windowPos; - window_close(*w); + WindowClose(*w); newWindow = WindowCreate(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } else diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index a45e6e06a7..46cf3666f3 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -425,7 +425,7 @@ void WindowDropdownShowImage( void WindowDropdownClose() { - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); } /** diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index dbc36d43f7..4f85b6d325 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -148,14 +148,14 @@ public: private: void JumpBackToObjectSelection() const { - window_close_all(); + WindowCloseAll(); gEditorStep = EditorStep::ObjectSelection; GfxInvalidateScreen(); } void JumpBackToLandscapeEditor() const { - window_close_all(); + WindowCloseAll(); set_all_scenery_items_invented(); ScenerySetDefaultPlacementConfiguration(); gEditorStep = EditorStep::LandscapeEditor; @@ -165,7 +165,7 @@ private: void JumpBackToInventionListSetUp() const { - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorInventionList); gEditorStep = EditorStep::InventionsListSetUp; GfxInvalidateScreen(); @@ -173,7 +173,7 @@ private: void JumpBackToOptionsSelection() const { - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorScenarioOptions); gEditorStep = EditorStep::OptionsSelection; GfxInvalidateScreen(); @@ -186,16 +186,16 @@ private: auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); if (missingObjectType == ObjectType::None) { - window_close_by_class(WindowClass::EditorObjectSelection); + WindowCloseByClass(WindowClass::EditorObjectSelection); return true; } ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); - w = window_find_by_class(WindowClass::EditorObjectSelection); + w = WindowFindByClass(WindowClass::EditorObjectSelection); if (w != nullptr) { // Click tab with missing object - window_event_mouse_up_call(w, WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); + WindowEventMouseUpCall(w, WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); } return false; } @@ -221,7 +221,7 @@ private: auto [checksPassed, errorString] = Editor::CheckPark(); if (checksPassed) { - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorInventionList); gEditorStep = EditorStep::InventionsListSetUp; } @@ -235,7 +235,7 @@ private: void JumpForwardToOptionsSelection() const { - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorScenarioOptions); gEditorStep = EditorStep::OptionsSelection; GfxInvalidateScreen(); @@ -243,7 +243,7 @@ private: void JumpForwardToObjectiveSelection() const { - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorObjectiveOptions); gEditorStep = EditorStep::ObjectiveSelection; GfxInvalidateScreen(); @@ -259,7 +259,7 @@ private: return; } - window_close_all(); + WindowCloseAll(); auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index b10231af4a..664c08aca1 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -209,7 +209,7 @@ public: { frame_no++; OnPrepareDraw(); - widget_invalidate(*this, WIDX_TAB_1); + WidgetInvalidate(*this, WIDX_TAB_1); if (WindowEditorInventionsListDragGetItem() != nullptr) return; @@ -476,7 +476,7 @@ public: if (windowPos.x <= screenCoords.x && windowPos.y < screenCoords.y && windowPos.x + width > screenCoords.x && windowPos.y + height > screenCoords.y) { - WidgetIndex widgetIndex = window_find_widget_from_point(*this, screenCoords); + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, screenCoords); auto& widget = widgets[widgetIndex]; if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL) { @@ -596,7 +596,7 @@ public: CursorID OnCursor(const WidgetIndex widx, const ScreenCoordsXY& screenCoords, const CursorID defaultCursor) override { - auto* inventionListWindow = static_cast(window_find_by_class(WindowClass::EditorInventionList)); + auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); if (inventionListWindow != nullptr) { auto res = inventionListWindow->GetResearchItemAt(screenCoords); @@ -613,7 +613,7 @@ public: void OnMoved(const ScreenCoordsXY& screenCoords) override { - auto* inventionListWindow = static_cast(window_find_by_class(WindowClass::EditorInventionList)); + auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); if (inventionListWindow == nullptr) { Close(); @@ -632,7 +632,7 @@ public: inventionListWindow->MoveResearchItem(_draggedItem, res->research, res->isInvented); } - window_invalidate_by_class(WindowClass::EditorInventionList); + WindowInvalidateByClass(WindowClass::EditorInventionList); Close(); } @@ -667,7 +667,7 @@ public: static void WindowEditorInventionsListDragOpen( ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { - window_close_by_class(WindowClass::EditorInventionListDrag); + WindowCloseByClass(WindowClass::EditorInventionListDrag); auto* wnd = WindowCreate( WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); if (wnd != nullptr) @@ -678,7 +678,7 @@ static void WindowEditorInventionsListDragOpen( static const ResearchItem* WindowEditorInventionsListDragGetItem() { - auto* wnd = static_cast(window_find_by_class(WindowClass::EditorInventionListDrag)); + auto* wnd = static_cast(WindowFindByClass(WindowClass::EditorInventionListDrag)); if (wnd == nullptr) { return nullptr; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index ff949d9cf8..e62979de1e 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -326,8 +326,8 @@ public: { if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) { - window_update_textbox_caret(); - widget_invalidate(*this, WIDX_FILTER_TEXT_BOX); + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); } for (WidgetIndex i = WIDX_FILTER_RIDE_TAB_TRANSPORT; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) @@ -339,7 +339,7 @@ public: if (frame_no >= window_editor_object_selection_animation_loops[i - WIDX_FILTER_RIDE_TAB_TRANSPORT]) frame_no = 0; - widget_invalidate(*this, i); + WidgetInvalidate(*this, i); break; } } @@ -353,7 +353,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); if (gScreenFlags & SCREEN_FLAGS_EDITOR) { finish_object_selection(); @@ -416,7 +416,7 @@ public: break; } case WIDX_FILTER_TEXT_BOX: - window_start_textbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string)); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string)); break; case WIDX_FILTER_CLEAR_BUTTON: std::fill_n(_filter_string, sizeof(_filter_string), 0x00); @@ -461,7 +461,7 @@ public: void OnResize() override { - window_set_resize(*this, WW, WH, 1200, 1000); + WindowSetResize(*this, WW, WH, 1200, 1000); } void OnMouseDown(WidgetIndex widgetIndex) override @@ -576,7 +576,7 @@ public: { // Used for in-game object selection cheat to prevent crashing the game // when windows attempt to draw objects that don't exist any more - window_close_all_except_class(WindowClass::EditorObjectSelection); + WindowCloseAllExceptClass(WindowClass::EditorObjectSelection); int32_t selected_object = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); if (selected_object == -1) @@ -600,7 +600,7 @@ public: return; // Close any other open windows such as options/colour schemes to prevent a crash. - window_close_all(); + WindowCloseAll(); // window_close(*w); // This function calls window_track_list_open diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 050c768dcc..e857dce7d6 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -198,7 +198,7 @@ rct_window* WindowEditorObjectiveOptionsOpen() { rct_window* w; - w = window_bring_to_front_by_class(WindowClass::EditorObjectiveOptions); + w = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions); if (w != nullptr) return w; @@ -273,8 +273,8 @@ static void WindowEditorObjectiveOptionsSetPage(rct_window* w, int32_t page) w->widgets = window_editor_objective_options_widgets[page]; w->Invalidate(); WindowEditorObjectiveOptionsUpdateDisabledWidgets(w); - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); } @@ -334,7 +334,7 @@ static void WindowEditorObjectiveOptionsMainMouseup(rct_window* w, WidgetIndex w switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -366,7 +366,7 @@ static void WindowEditorObjectiveOptionsMainMouseup(rct_window* w, WidgetIndex w */ static void WindowEditorObjectiveOptionsMainResize(rct_window* w) { - window_set_resize(*w, 450, 229, 450, 229); + WindowSetResize(*w, 450, 229, 450, 229); } static void WindowEditorObjectiveOptionsShowObjectiveDropdown(rct_window* w) @@ -649,8 +649,8 @@ static void WindowEditorObjectiveOptionsMainUpdate(rct_window* w) uint8_t objectiveType; w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_1); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_1); parkFlags = gParkFlags; objectiveType = gScenarioObjective.Type; @@ -911,7 +911,7 @@ static void WindowEditorObjectiveOptionsRidesMouseup(rct_window* w, WidgetIndex switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -926,7 +926,7 @@ static void WindowEditorObjectiveOptionsRidesMouseup(rct_window* w, WidgetIndex */ static void WindowEditorObjectiveOptionsRidesResize(rct_window* w) { - window_set_resize(*w, 380, 224, 380, 224); + WindowSetResize(*w, 380, 224, 380, 224); } /** @@ -936,9 +936,9 @@ static void WindowEditorObjectiveOptionsRidesResize(rct_window* w) static void WindowEditorObjectiveOptionsRidesUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - window_event_resize_call(w); - widget_invalidate(*w, WIDX_TAB_2); + WindowEventInvalidateCall(w); + WindowEventResizeCall(w); + WidgetInvalidate(*w, WIDX_TAB_2); auto numItems = 0; for (auto& ride : GetRideManager()) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 264102fdd9..9880c93d45 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -371,7 +371,7 @@ private: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -399,7 +399,7 @@ private: void FinancialResize() { - window_set_resize(*this, 280, 149, 280, 149); + WindowSetResize(*this, 280, 149, 280, 149); } void ShowClimateDropdown() @@ -531,8 +531,8 @@ private: if (gScreenFlags == SCREEN_FLAGS_PLAYING) { - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); } } @@ -540,7 +540,7 @@ private: { frame_no++; FinancialPrepareDraw(); - widget_invalidate(*this, WIDX_TAB_1); + WidgetInvalidate(*this, WIDX_TAB_1); } void FinancialPrepareDraw() @@ -652,7 +652,7 @@ private: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -680,7 +680,7 @@ private: void GuestsResize() { - window_set_resize(*this, 380, 149, 380, 149); + WindowSetResize(*this, 380, 149, 380, 149); } void GuestsMouseDown(WidgetIndex widgetIndex) @@ -798,7 +798,7 @@ private: { frame_no++; GuestsPrepareDraw(); - widget_invalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_2); } void GuestsPrepareDraw() @@ -898,7 +898,7 @@ private: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -951,7 +951,7 @@ private: void ParkResize() { - window_set_resize(*this, 400, 200, 400, 200); + WindowSetResize(*this, 400, 200, 400, 200); } void ParkMouseDown(WidgetIndex widgetIndex) @@ -1097,7 +1097,7 @@ private: { frame_no++; ParkPrepareDraw(); - widget_invalidate(*this, WIDX_TAB_3); + WidgetInvalidate(*this, WIDX_TAB_3); } void ParkPrepareDraw() diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 225d68c53b..2369d9c908 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -109,7 +109,7 @@ public: rct_window* WindowErrorOpen(std::string_view title, std::string_view message) { - window_close_by_class(WindowClass::Error); + WindowCloseByClass(WindowClass::Error); std::string buffer = "{BLACK}"; buffer.append(title); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 5bdfd727c2..f6071729bc 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -461,8 +461,8 @@ public: width = WW_OTHER_TABS; height = WH_OTHER_TABS; } - window_event_resize_call(this); - window_event_invalidate_call(this); + WindowEventResizeCall(this); + WindowEventInvalidateCall(this); WindowInitScrollWidgets(*this); diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index edc3bc450a..9910b483a8 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -167,12 +167,12 @@ public: widgets = window_footpath_widgets; WindowInitScrollWidgets(*this); - window_push_others_right(*this); + WindowPushOthersRight(*this); show_gridlines(); - tool_cancel(); + ToolCancel(); _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); input_set_flag(INPUT_FLAG_6, true); _footpathErrorOccured = false; WindowFootpathSetEnabledAndPressedWidgets(); @@ -184,13 +184,13 @@ public: viewport_set_visibility(0); MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); hide_gridlines(); } void OnUpdate() override { - widget_invalidate(*this, WIDX_CONSTRUCT); + WidgetInvalidate(*this, WIDX_CONSTRUCT); WindowFootpathUpdateProvisionalPathForBridgeMode(); // #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed @@ -291,12 +291,12 @@ public: } _windowFootpathCost = MONEY32_UNDEFINED; - tool_cancel(); + ToolCancel(); FootpathProvisionalUpdate(); MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); input_set_flag(INPUT_FLAG_6, true); _footpathErrorOccured = false; WindowFootpathSetEnabledAndPressedWidgets(); @@ -308,12 +308,12 @@ public: } _windowFootpathCost = MONEY32_UNDEFINED; - tool_cancel(); + ToolCancel(); FootpathProvisionalUpdate(); MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; - tool_set(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); + ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); _footpathErrorOccured = false; WindowFootpathSetEnabledAndPressedWidgets(); @@ -540,7 +540,7 @@ private: auto pathConstructFlags = FootpathCreateConstructFlags(type); _windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags); - widget_invalidate(*this, WIDX_CONSTRUCT); + WidgetInvalidate(*this, WIDX_CONSTRUCT); } auto curTime = Platform::GetTicks(); @@ -841,7 +841,7 @@ private: auto constructFlags = FootpathCreateConstructFlags(pathType); _windowFootpathCost = FootpathProvisionalSet( pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); - window_invalidate_by_class(WindowClass::Footpath); + WindowInvalidateByClass(WindowClass::Footpath); } } @@ -1004,7 +1004,7 @@ private: } } - tool_cancel(); + ToolCancel(); gFootpathConstructFromPosition = { mapCoords, z }; _footpathConstructDirection = direction; gProvisionalFootpath.Flags = 0; @@ -1422,9 +1422,9 @@ void WindowFootpathResetSelectedPath() gFootpathSelection = {}; } -void window_footpath_keyboard_shortcut_turn_left() +void WindowFootpathKeyboardShortcutTurnLeft() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); @@ -1435,9 +1435,9 @@ void window_footpath_keyboard_shortcut_turn_left() } } -void window_footpath_keyboard_shortcut_turn_right() +void WindowFootpathKeyboardShortcutTurnRight() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); @@ -1448,9 +1448,9 @@ void window_footpath_keyboard_shortcut_turn_right() } } -void window_footpath_keyboard_shortcut_slope_down() +void WindowFootpathKeyboardShortcutSlopeDown() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); @@ -1461,9 +1461,9 @@ void window_footpath_keyboard_shortcut_slope_down() } } -void window_footpath_keyboard_shortcut_slope_up() +void WindowFootpathKeyboardShortcutSlopeUp() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); @@ -1474,9 +1474,9 @@ void window_footpath_keyboard_shortcut_slope_up() } } -void window_footpath_keyboard_shortcut_demolish_current() +void WindowFootpathKeyboardShortcutDemolishCurrent() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); @@ -1487,9 +1487,9 @@ void window_footpath_keyboard_shortcut_demolish_current() } } -void window_footpath_keyboard_shortcut_build_current() +void WindowFootpathKeyboardShortcutBuildCurrent() { - rct_window* w = window_find_by_class(WindowClass::Footpath); + rct_window* w = WindowFindByClass(WindowClass::Footpath); if (w != nullptr) { auto* footpathWindow = static_cast(w); diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 5aef63fa55..8138a40bac 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -176,9 +176,9 @@ static void WindowGameBottomToolbarMouseup(rct_window* w, WidgetIndex widgetInde if (!subjectLoc.has_value()) break; - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) - window_scroll_to_location(*mainWindow, subjectLoc.value()); + WindowScrollToLocation(*mainWindow, subjectLoc.value()); } break; case WIDX_RIGHT_OUTSET: @@ -338,7 +338,7 @@ void WindowGameBottomToolbarInvalidateNewsItem() { if (gScreenFlags == SCREEN_FLAGS_PLAYING) { - widget_invalidate_by_class(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET); + WidgetInvalidateByClass(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET); } } @@ -733,30 +733,30 @@ static void WindowGameBottomToolbarInvalidateDirtyWidgets(rct_window* w) if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_MONEY) { gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_MONEY; - widget_invalidate(*w, WIDX_LEFT_INSET); + WidgetInvalidate(*w, WIDX_LEFT_INSET); } if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_DATE) { gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_DATE; - widget_invalidate(*w, WIDX_RIGHT_INSET); + WidgetInvalidate(*w, WIDX_RIGHT_INSET); } if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PEEP_COUNT) { gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PEEP_COUNT; - widget_invalidate(*w, WIDX_LEFT_INSET); + WidgetInvalidate(*w, WIDX_LEFT_INSET); } if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_CLIMATE) { gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_CLIMATE; - widget_invalidate(*w, WIDX_RIGHT_INSET); + WidgetInvalidate(*w, WIDX_RIGHT_INSET); } if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PARK_RATING) { gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PARK_RATING; - widget_invalidate(*w, WIDX_LEFT_INSET); + WidgetInvalidate(*w, WIDX_LEFT_INSET); } } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 1dbd390614..e3e901a4dc 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -196,7 +196,7 @@ public: if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - tool_cancel(); + ToolCancel(); } } @@ -419,7 +419,7 @@ private: } maxWidth = std::max(minWidth, maxWidth); - window_set_resize(*this, minWidth, minHeight, maxWidth, maxHeight); + WindowSetResize(*this, minWidth, minHeight, maxWidth, maxHeight); } void OnPrepareDrawCommon() @@ -442,7 +442,7 @@ private: ResizeFrameWithPage(); - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); } void DisableWidgets() @@ -481,7 +481,7 @@ private: if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) - tool_cancel(); + ToolCancel(); } int32_t listen = 0; if (newPage == WINDOW_GUEST_OVERVIEW && page == WINDOW_GUEST_OVERVIEW && viewport != nullptr) @@ -581,7 +581,7 @@ private: DisableWidgets(); OnPrepareDraw(); - widget_invalidate(*this, WIDX_MARQUEE); + WidgetInvalidate(*this, WIDX_MARQUEE); OnResizeCommon(); @@ -624,10 +624,10 @@ private: pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - rct_window* wind = window_find_by_number(WindowClass::Peep, peepnum); + rct_window* wind = WindowFindByNumber(WindowClass::Peep, peepnum); if (wind != nullptr) { - tool_set(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker); + ToolSet(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker); } }); GameActions::Execute(&pickupAction); @@ -691,8 +691,8 @@ private: void GuestFollow() { - rct_window* main = window_get_main(); - window_follow_sprite(*main, EntityId::FromUnderlying(number)); + rct_window* main = WindowGetMain(); + WindowFollowSprite(*main, EntityId::FromUnderlying(number)); } void OnViewportRotateOverview() @@ -751,7 +751,7 @@ private: // Draw the viewport no sound sprite if (viewport != nullptr) { - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) { GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 }); @@ -854,8 +854,8 @@ private: newAnimationFrame %= 24; _guestAnimationFrame = newAnimationFrame; - widget_invalidate(*this, WIDX_TAB_1); - widget_invalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_1); + WidgetInvalidate(*this, WIDX_TAB_2); const auto peep = GetGuest(); if (peep == nullptr) @@ -865,7 +865,7 @@ private: if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_ACTION) { peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_ACTION; - widget_invalidate(*this, WIDX_ACTION_LBL); + WidgetInvalidate(*this, WIDX_ACTION_LBL); } _marqueePosition += 2; @@ -964,7 +964,7 @@ private: pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - tool_cancel(); + ToolCancel(); gPickupPeepImage = ImageId(); }); GameActions::Execute(&pickupAction); @@ -1225,8 +1225,8 @@ private: { frame_no++; - widget_invalidate(*this, WIDX_TAB_2); - widget_invalidate(*this, WIDX_TAB_3); + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_3); const auto guest = GetGuest(); if (guest == nullptr) @@ -1400,8 +1400,8 @@ private: { frame_no++; - widget_invalidate(*this, WIDX_TAB_2); - widget_invalidate(*this, WIDX_TAB_4); + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_4); } void OnDrawFinance(rct_drawpixelinfo& dpi) @@ -1538,8 +1538,8 @@ private: { frame_no++; - widget_invalidate(*this, WIDX_TAB_2); - widget_invalidate(*this, WIDX_TAB_5); + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_5); auto peep = GetGuest(); if (peep == nullptr) @@ -1613,8 +1613,8 @@ private: { frame_no++; - widget_invalidate(*this, WIDX_TAB_2); - widget_invalidate(*this, WIDX_TAB_6); + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_6); auto peep = GetGuest(); if (peep == nullptr) @@ -1918,8 +1918,7 @@ rct_window* WindowGuestOpen(Peep* peep) return WindowStaffOpen(peep); } - auto* window = static_cast( - window_bring_to_front_by_number(WindowClass::Peep, peep->sprite_index.ToUnderlying())); + auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->sprite_index.ToUnderlying())); if (window == nullptr) { int32_t windowWidth = 192; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index ca54129b96..b96e56bb47 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -956,7 +956,7 @@ private: rct_window* WindowGuestListOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::GuestList); + auto* window = WindowBringToFrontByClass(WindowClass::GuestList); if (window == nullptr) { window = WindowCreate(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); @@ -979,7 +979,7 @@ rct_window* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t inde void WindowGuestListRefreshList() { - auto* w = window_find_by_class(WindowClass::GuestList); + auto* w = WindowFindByClass(WindowClass::GuestList); if (w != nullptr) { static_cast(w)->RefreshList(); diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 28c4b26b87..f5de815e9d 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -85,7 +85,7 @@ public: track_list.track_list_being_updated = false; WindowInitScrollWidgets(*this); - window_push_others_right(*this); + WindowPushOthersRight(*this); } void OnClose() override @@ -130,7 +130,7 @@ public: _trackName = std::string(text); - window_event_mouse_up_call(this, WIDX_INSTALL); + WindowEventMouseUpCall(this, WIDX_INSTALL); } void OnPrepareDraw() override @@ -422,8 +422,8 @@ rct_window* WindowInstallTrackOpen(const utf8* path) return nullptr; } - window_close_by_class(WindowClass::EditorObjectSelection); - window_close_construction_windows(); + WindowCloseByClass(WindowClass::EditorObjectSelection); + WindowCloseConstructionWindows(); gTrackDesignSceneryToggle = false; _currentTrackPieceDirection = 2; diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 4982e8ed5a..aea14eb5c2 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -72,7 +72,7 @@ public: widgets = window_land_widgets; hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); gLandToolSize = 1; gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; @@ -89,7 +89,7 @@ public: { // If the tool wasn't changed, turn tool off if (LandToolIsActive()) - tool_cancel(); + ToolCancel(); } void OnMouseUp(WidgetIndex widgetIndex) override diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 8cdd3a3d5e..2230a71604 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -60,14 +60,14 @@ public: widgets = window_land_rights_widgets; hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; pressed_widgets = (1uLL << WIDX_BUY_LAND_RIGHTS); gLandToolSize = 1; show_gridlines(); - tool_set(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); + ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); input_set_flag(INPUT_FLAG_6, true); show_land_rights(); @@ -88,7 +88,7 @@ public: // If the tool wasn't changed, turn tool off if (LandRightsToolIsActive()) - tool_cancel(); + ToolCancel(); } void OnMouseUp(WidgetIndex widgetIndex) override @@ -104,7 +104,7 @@ public: case WIDX_BUY_LAND_RIGHTS: if (_landRightsMode != LAND_RIGHTS_MODE_BUY_LAND) { - tool_set(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); + ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; show_land_rights(); Invalidate(); @@ -113,7 +113,7 @@ public: case WIDX_BUY_CONSTRUCTION_RIGHTS: if (_landRightsMode != LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS) { - tool_set(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow); + ToolSet(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow); _landRightsMode = LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS; show_construction_rights(); Invalidate(); @@ -247,7 +247,7 @@ public: if (_landRightsCost != MONEY32_UNDEFINED) { _landRightsCost = MONEY32_UNDEFINED; - window_invalidate_by_class(WindowClass::ClearScenery); + WindowInvalidateByClass(WindowClass::ClearScenery); } return; } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index a40cf7e428..9dee1766da 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -272,7 +272,7 @@ static void Select(const char* path) if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer)) { InvokeCallback(MODAL_RESULT_OK, pathBuffer); - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); } else @@ -292,7 +292,7 @@ static void Select(const char* path) gIsAutosaveLoaded = false; gFirstTimeSaving = false; - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); InvokeCallback(MODAL_RESULT_OK, pathBuffer); @@ -326,7 +326,7 @@ static void Select(const char* path) if (scenario_save(pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2)) { gCurrentLoadedPath = pathBuffer; - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); InvokeCallback(MODAL_RESULT_OK, pathBuffer); } @@ -349,7 +349,7 @@ static void Select(const char* path) if (success) { - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); title_load(); } @@ -368,7 +368,7 @@ static void Select(const char* path) auto intent = Intent(WindowClass::InstallTrack); intent.putExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); ContextOpenIntent(&intent); - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); break; } @@ -386,7 +386,7 @@ static void Select(const char* path) if (success) { - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); WindowRideMeasurementsDesignCancel(); InvokeCallback(MODAL_RESULT_OK, path); } @@ -399,7 +399,7 @@ static void Select(const char* path) } case (LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP): - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); break; } @@ -703,7 +703,7 @@ public: void OnClose() override { _listItems.clear(); - window_close_by_class(WindowClass::LoadsaveOverwritePrompt); + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); } void OnResize() override @@ -1057,7 +1057,7 @@ rct_window* WindowLoadsaveOpen( const u8string path = GetDir(type); - auto* w = static_cast(window_bring_to_front_by_class(WindowClass::Loadsave)); + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Loadsave)); if (w == nullptr) { w = WindowCreate( @@ -1133,7 +1133,7 @@ static rct_window* WindowOverwritePromptOpen(const char* name, const char* path) { rct_window* w; - window_close_by_class(WindowClass::LoadsaveOverwritePrompt); + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); w = WindowCreateCentred( OVERWRITE_WW, OVERWRITE_WH, &window_overwrite_prompt_events, WindowClass::LoadsaveOverwritePrompt, WF_STICK_TO_FRONT); @@ -1160,13 +1160,13 @@ static void WindowOverwritePromptMouseup(rct_window* w, WidgetIndex widgetIndex) // As the LoadSaveWindow::Select function can change the order of the // windows we can't use window_close(w). - window_close_by_class(WindowClass::LoadsaveOverwritePrompt); + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); break; } case WIDX_OVERWRITE_CANCEL: case WIDX_OVERWRITE_CLOSE: - window_close(*w); + WindowClose(*w); break; } } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index e2bbf757b1..bc3eb5fb93 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -174,7 +174,7 @@ public: if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification && gCurrentToolWidget.window_number == number) { - tool_cancel(); + ToolCancel(); } } @@ -196,7 +196,7 @@ public: break; case WIDX_SET_LAND_RIGHTS: Invalidate(); - if (tool_set(*this, widgetIndex, Tool::UpArrow)) + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) break; _activeTool = 2; // Prevent mountain tool size. @@ -239,7 +239,7 @@ public: break; case WIDX_BUILD_PARK_ENTRANCE: Invalidate(); - if (tool_set(*this, widgetIndex, Tool::UpArrow)) + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) break; gParkEntranceGhostExists = false; @@ -253,7 +253,7 @@ public: gWindowSceneryRotation = (gWindowSceneryRotation + 1) & 3; break; case WIDX_PEOPLE_STARTING_POSITION: - if (tool_set(*this, widgetIndex, Tool::UpArrow)) + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) break; show_gridlines(); @@ -650,10 +650,10 @@ public: auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) }; auto mapZ = TileElementHeight(mapCoords); - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - window_scroll_to_location(*mainWindow, { mapCoords, mapZ }); + WindowScrollToLocation(*mainWindow, { mapCoords, mapZ }); } if (LandToolIsActive()) @@ -928,7 +928,7 @@ private: void CentreMapOnViewPoint() { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); int16_t ax, bx, cx, dx; int16_t bp, di; @@ -1243,7 +1243,7 @@ private: */ void PaintHudRectangle(rct_drawpixelinfo* dpi) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow == nullptr) return; @@ -1461,7 +1461,7 @@ void WindowMapReset() rct_window* w; // Check if window is even opened - w = window_bring_to_front_by_class(WindowClass::Map); + w = WindowBringToFrontByClass(WindowClass::Map); if (w == nullptr) { return; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index fd392fd7ab..a8d75b9ccd 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -421,7 +421,7 @@ static void WindowMapgenChangeMapSize(int32_t sizeOffset) rct_window* WindowMapgenOpen() { - rct_window* w = window_bring_to_front_by_class(WindowClass::Mapgen); + rct_window* w = WindowBringToFrontByClass(WindowClass::Mapgen); if (w != nullptr) { return w; @@ -455,7 +455,7 @@ static void WindowMapgenSharedMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -620,7 +620,7 @@ static void WindowMapgenBaseUpdate(rct_window* w) // Tab animation if (++w->frame_no >= TabAnimationLoops[w->page]) w->frame_no = 0; - widget_invalidate(*w, WIDX_TAB_1); + WidgetInvalidate(*w, WIDX_TAB_1); } static void WindowMapgenTextinput(rct_window* w, WidgetIndex widgetIndex, char* text) @@ -809,7 +809,7 @@ static void WindowMapgenRandomUpdate(rct_window* w) // Tab animation if (++w->frame_no >= TabAnimationLoops[w->page]) w->frame_no = 0; - widget_invalidate(*w, WIDX_TAB_2); + WidgetInvalidate(*w, WIDX_TAB_2); } static void WindowMapgenRandomInvalidate(rct_window* w) @@ -1007,7 +1007,7 @@ static void WindowMapgenSimplexUpdate(rct_window* w) // Tab animation if (++w->frame_no >= TabAnimationLoops[w->page]) w->frame_no = 0; - widget_invalidate(*w, WIDX_TAB_3); + WidgetInvalidate(*w, WIDX_TAB_3); } static void WindowMapgenSimplexInvalidate(rct_window* w) @@ -1120,37 +1120,37 @@ static void WindowMapgenHeightmapMousedown(rct_window* w, WidgetIndex widgetInde { case WIDX_HEIGHTMAP_STRENGTH_UP: _heightmapSmoothStrength = std::min(_heightmapSmoothStrength + 1, MAX_SMOOTH_ITERATIONS); - widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH); break; case WIDX_HEIGHTMAP_STRENGTH_DOWN: _heightmapSmoothStrength = std::max(_heightmapSmoothStrength - 1, 1); - widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH); break; case WIDX_HEIGHTMAP_LOW_UP: _heightmapLow = std::min(_heightmapLow + 1, 142 - 1); _heightmapHigh = std::max(_heightmapHigh, _heightmapLow + 1); - widget_invalidate(*w, WIDX_HEIGHTMAP_LOW); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_LOW); break; case WIDX_HEIGHTMAP_LOW_DOWN: _heightmapLow = std::max(_heightmapLow - 1, 2); - widget_invalidate(*w, WIDX_HEIGHTMAP_LOW); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_LOW); break; case WIDX_HEIGHTMAP_HIGH_UP: _heightmapHigh = std::min(_heightmapHigh + 1, 142); - widget_invalidate(*w, WIDX_HEIGHTMAP_HIGH); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_HIGH); break; case WIDX_HEIGHTMAP_HIGH_DOWN: _heightmapHigh = std::max(_heightmapHigh - 1, 2 + 1); _heightmapLow = std::min(_heightmapLow, _heightmapHigh - 1); - widget_invalidate(*w, WIDX_HEIGHTMAP_HIGH); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_HIGH); break; case WIDX_HEIGHTMAP_WATER_LEVEL_UP: _waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT); - widget_invalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL); break; case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN: _waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0); - widget_invalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_WATER_LEVEL); break; } } @@ -1216,18 +1216,18 @@ static void WindowMapgenHeightmapMouseup(rct_window* w, WidgetIndex widgetIndex) WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap); WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap); WidgetSetEnabled(*w, WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap); - widget_invalidate(*w, WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP); - widget_invalidate(*w, WIDX_HEIGHTMAP_STRENGTH); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_STRENGTH); break; case WIDX_HEIGHTMAP_NORMALIZE: _heightmapNormalize = !_heightmapNormalize; WidgetSetCheckboxValue(*w, WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize); - widget_invalidate(*w, WIDX_HEIGHTMAP_NORMALIZE); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_NORMALIZE); break; case WIDX_HEIGHTMAP_SMOOTH_TILES: _heightmapSmoothTiles = !_heightmapSmoothTiles; WidgetSetCheckboxValue(*w, WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles); - widget_invalidate(*w, WIDX_HEIGHTMAP_SMOOTH_TILES); + WidgetInvalidate(*w, WIDX_HEIGHTMAP_SMOOTH_TILES); break; } diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 6d9ef6f33b..c224233b36 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -61,7 +61,7 @@ void WindowMapTooltipUpdateVisibility() if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) { // The map tooltip is drawn by the bottom toolbar - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::BottomToolbar); return; } @@ -84,9 +84,9 @@ void WindowMapTooltipUpdateVisibility() if (_cursorHoldDuration < 25 || stringId == STR_NONE || InputTestPlaceObjectModifier( static_cast(PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z)) - || window_find_by_class(WindowClass::Error) != nullptr) + || WindowFindByClass(WindowClass::Error) != nullptr) { - window_close_by_class(WindowClass::MapTooltip); + WindowCloseByClass(WindowClass::MapTooltip); } else { @@ -107,7 +107,7 @@ static void WindowMapTooltipOpen() const CursorState* state = ContextGetCursorState(); ScreenCoordsXY pos = { state->position.x - (width / 2), state->position.y + 15 }; - w = window_find_by_class(WindowClass::MapTooltip); + w = WindowFindByClass(WindowClass::MapTooltip); if (w == nullptr) { w = WindowCreate( diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index dd527ad93b..a7e80954d5 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -115,7 +115,7 @@ public: // In order to cancel the yellow arrow correctly the // selection tool should be cancelled. - tool_cancel(); + ToolCancel(); hide_gridlines(); @@ -185,7 +185,7 @@ public: { if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) { - widget_invalidate(*this, i); + WidgetInvalidate(*this, i); } } disabled_widgets = disabledWidgets; @@ -244,7 +244,7 @@ public: if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) { - tool_cancel(); + ToolCancel(); } break; default: @@ -258,11 +258,11 @@ public: switch (widgetIndex) { case WIDX_MAZE_DIRECTION_GROUPBOX: - ride_construction_toolupdate_construct(screenCoords); + RideConstructionToolupdateConstruct(screenCoords); break; case WIDX_MAZE_ENTRANCE: case WIDX_MAZE_EXIT: - ride_construction_toolupdate_entrance_exit(screenCoords); + RideConstructionToolupdateEntranceExit(screenCoords); break; } } @@ -272,7 +272,7 @@ public: switch (widgetIndex) { case WIDX_MAZE_DIRECTION_GROUPBOX: - ride_construction_tooldown_construct(screenCoords); + RideConstructionTooldownConstruct(screenCoords); break; case WIDX_MAZE_ENTRANCE: case WIDX_MAZE_EXIT: @@ -305,7 +305,7 @@ public: private: void WindowMazeConstructionEntranceMouseup(WidgetIndex widgetIndex) { - if (tool_set(*this, widgetIndex, Tool::Crosshair)) + if (ToolSet(*this, widgetIndex, Tool::Crosshair)) return; gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT; @@ -328,7 +328,7 @@ private: { if (_rideConstructionState == RideConstructionState::EntranceExit) { - tool_cancel(); + ToolCancel(); } _rideConstructionState = rideConstructionState; WindowMazeConstructionUpdatePressedWidgets(); @@ -365,14 +365,14 @@ private: auto currentRide = get_ride(rideIndex); if (currentRide != nullptr && ride_are_all_possible_entrances_and_exits_built(*currentRide).Successful) { - tool_cancel(); + ToolCancel(); if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) - window_close_by_class(WindowClass::RideConstruction); + WindowCloseByClass(WindowClass::RideConstruction); } else { gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; - window_invalidate_by_class(WindowClass::RideConstruction); + WindowInvalidateByClass(WindowClass::RideConstruction); gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) ? WIDX_MAZE_ENTRANCE : WIDX_MAZE_EXIT; @@ -438,7 +438,7 @@ void WindowMazeConstructionUpdatePressedWidgets() { rct_window* w; - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr) return; diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 1dc79089e0..aaac17af0c 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -232,7 +232,7 @@ static ScreenCoordsXY _windowInformationSize; rct_window* WindowMultiplayerOpen() { // Check if window is already open - rct_window* window = window_bring_to_front_by_class(WindowClass::Multiplayer); + rct_window* window = WindowBringToFrontByClass(WindowClass::Multiplayer); if (window == nullptr) { window = WindowCreateAutoPos( @@ -258,8 +258,8 @@ static void WindowMultiplayerSetPage(rct_window* w, int32_t page) w->widgets = window_multiplayer_page_widgets[page]; w->widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); } @@ -313,7 +313,7 @@ static void WindowMultiplayerInformationMouseup(rct_window* w, WidgetIndex widge switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB1: case WIDX_TAB2: @@ -380,20 +380,20 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize() static void WindowMultiplayerInformationResize(rct_window* w) { auto size = WindowMultiplayerInformationGetSize(); - window_set_resize(*w, size.x, size.y, size.x, size.y); + WindowSetResize(*w, size.x, size.y, size.x, size.y); } static void WindowMultiplayerInformationUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB1 + w->page); + WidgetInvalidate(*w, WIDX_TAB1 + w->page); } static void WindowMultiplayerInformationInvalidate(rct_window* w) { WindowMultiplayerSetPressedTab(w); WindowMultiplayerAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB1, WIDX_TAB4); + WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4); } static void WindowMultiplayerInformationPaint(rct_window* w, rct_drawpixelinfo* dpi) @@ -468,7 +468,7 @@ static void WindowMultiplayerPlayersMouseup(rct_window* w, WidgetIndex widgetInd switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB1: case WIDX_TAB2: @@ -484,7 +484,7 @@ static void WindowMultiplayerPlayersMouseup(rct_window* w, WidgetIndex widgetInd static void WindowMultiplayerPlayersResize(rct_window* w) { - window_set_resize(*w, 420, 124, 500, 450); + WindowSetResize(*w, 420, 124, 500, 450); w->no_list_items = (IsServerPlayerInvisible() ? network_get_num_visible_players() : network_get_num_players()); w->list_item_positions[0] = 0; @@ -498,7 +498,7 @@ static void WindowMultiplayerPlayersResize(rct_window* w) static void WindowMultiplayerPlayersUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB1 + w->page); + WidgetInvalidate(*w, WIDX_TAB1 + w->page); } static void WindowMultiplayerPlayersScrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) @@ -555,7 +555,7 @@ static void WindowMultiplayerPlayersInvalidate(rct_window* w) WindowMultiplayerAnchorBorderWidgets(w); window_multiplayer_players_widgets[WIDX_LIST].right = w->width - 4; window_multiplayer_players_widgets[WIDX_LIST].bottom = w->height - 0x0F; - window_align_tabs(w, WIDX_TAB1, WIDX_TAB4); + WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4); } static void WindowMultiplayerPlayersPaint(rct_window* w, rct_drawpixelinfo* dpi) @@ -682,7 +682,7 @@ static void WindowMultiplayerGroupsMouseup(rct_window* w, WidgetIndex widgetInde switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB1: case WIDX_TAB2: @@ -715,7 +715,7 @@ static void WindowMultiplayerGroupsMouseup(rct_window* w, WidgetIndex widgetInde static void WindowMultiplayerGroupsResize(rct_window* w) { - window_set_resize(*w, 320, 200, 320, 500); + WindowSetResize(*w, 320, 200, 320, 500); w->no_list_items = network_get_num_actions(); w->list_item_positions[0] = 0; @@ -764,7 +764,7 @@ static void WindowMultiplayerGroupsDropdown(rct_window* w, WidgetIndex widgetInd static void WindowMultiplayerGroupsUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB1 + w->page); + WidgetInvalidate(*w, WIDX_TAB1 + w->page); } static void WindowMultiplayerGroupsScrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) @@ -834,7 +834,7 @@ static void WindowMultiplayerGroupsInvalidate(rct_window* w) WindowMultiplayerAnchorBorderWidgets(w); window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].right = w->width - 4; window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].bottom = w->height - 0x0F; - window_align_tabs(w, WIDX_TAB1, WIDX_TAB4); + WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4); // select other group if one is removed while (network_get_group_index(_selectedGroup) == -1 && _selectedGroup > 0) @@ -940,7 +940,7 @@ static void WindowMultiplayerOptionsMouseup(rct_window* w, WidgetIndex widgetInd switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB1: case WIDX_TAB2: @@ -968,20 +968,20 @@ static void WindowMultiplayerOptionsMouseup(rct_window* w, WidgetIndex widgetInd static void WindowMultiplayerOptionsResize(rct_window* w) { - window_set_resize(*w, 300, 100, 300, 100); + WindowSetResize(*w, 300, 100, 300, 100); } static void WindowMultiplayerOptionsUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB1 + w->page); + WidgetInvalidate(*w, WIDX_TAB1 + w->page); } static void WindowMultiplayerOptionsInvalidate(rct_window* w) { WindowMultiplayerSetPressedTab(w); WindowMultiplayerAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB1, WIDX_TAB4); + WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4); if (network_get_mode() == NETWORK_MODE_CLIENT) { diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 229f5482e0..c55e6e8103 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -142,7 +142,7 @@ rct_window* WindowNetworkStatusOpen(const std::string& text, close_callback onCl // force close void WindowNetworkStatusClose() { - auto window = window_find_by_class(WindowClass::NetworkStatus); + auto window = WindowFindByClass(WindowClass::NetworkStatus); if (window == nullptr) { return; diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 6bf24c9be9..c78242c33c 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -260,7 +260,7 @@ public: gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - window_close_by_class(WindowClass::NewCampaign); + WindowCloseByClass(WindowClass::NewCampaign); } }); GameActions::Execute(&gameAction); @@ -373,13 +373,13 @@ public: rct_window* WindowNewCampaignOpen(int16_t campaignType) { - auto w = static_cast(window_bring_to_front_by_class(WindowClass::NewCampaign)); + auto w = static_cast(WindowBringToFrontByClass(WindowClass::NewCampaign)); if (w != nullptr) { if (w->campaign.campaign_type == campaignType) return w; - window_close(*w); + WindowClose(*w); } w = WindowCreate(WindowClass::NewCampaign, WW, WH, 0); @@ -392,7 +392,7 @@ rct_window* WindowNewCampaignOpen(int16_t campaignType) void WindowCampaignRefreshRides() { - auto w = static_cast(window_find_by_class(WindowClass::NewCampaign)); + auto w = static_cast(WindowFindByClass(WindowClass::NewCampaign)); if (w != nullptr) { w->RefreshRides(); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 76aab2240f..56ce8ec56f 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -307,7 +307,7 @@ public: if (frame_no >= TabAnimationLoops[_currentTab]) frame_no = 0; - widget_invalidate(*this, WIDX_TAB_1 + static_cast(_currentTab)); + WidgetInvalidate(*this, WIDX_TAB_1 + static_cast(_currentTab)); if (new_ride.SelectedRide.Type != RIDE_TYPE_NULL && new_ride.selected_ride_countdown-- == 0) { @@ -324,7 +324,7 @@ public: if (!WidgetIsHighlighted(*this, WIDX_RIDE_LIST)) { new_ride.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; - widget_invalidate(*this, WIDX_RIDE_LIST); + WidgetInvalidate(*this, WIDX_RIDE_LIST); } } } @@ -522,7 +522,7 @@ private: } Close(); - window_close_construction_windows(); + WindowCloseConstructionWindows(); auto count = GetNumTrackDesigns(item); if (count > 0) @@ -811,7 +811,7 @@ private: // Get maximum scroll height int32_t scrollWidth = 0; int32_t scrollHeight = 0; - window_get_scroll_size(this, 0, &scrollWidth, &scrollHeight); + WindowGetScrollSize(this, 0, &scrollWidth, &scrollHeight); const Widget& listWidget = widgets[WIDX_RIDE_LIST]; const int32_t listWidgetHeight = listWidget.bottom - listWidget.top - 1; @@ -950,14 +950,14 @@ rct_window* WindowNewRideOpen() { rct_window* window; - window = window_bring_to_front_by_class(WindowClass::ConstructRide); + window = WindowBringToFrontByClass(WindowClass::ConstructRide); if (window) { return window; } - window_close_by_class(WindowClass::TrackDesignList); - window_close_by_class(WindowClass::TrackDesignPlace); + WindowCloseByClass(WindowClass::TrackDesignList); + WindowCloseByClass(WindowClass::TrackDesignPlace); window = WindowCreate(WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); return window; @@ -976,7 +976,7 @@ rct_window* WindowNewRideOpenResearch() */ void WindowNewRideFocus(RideSelection rideItem) { - auto w = static_cast(window_find_by_class(WindowClass::ConstructRide)); + auto w = static_cast(WindowFindByClass(WindowClass::ConstructRide)); if (!w) { return; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 9146efcc79..e1e3a5cd15 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -62,7 +62,7 @@ public: int32_t w = 0, h = 0; Widget* widget = &widgets[WIDX_SCROLL]; - window_get_scroll_size(this, 0, &w, &h); + WindowGetScrollSize(this, 0, &w, &h); scrolls[0].v_top = std::max(0, h - (widget->height() - 1)); WidgetScrollUpdateThumbs(*this, WIDX_SCROLL); } @@ -112,9 +112,9 @@ public: { static rct_window* _mainWindow; auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc); - if (subjectLoc.has_value() && (_mainWindow = window_get_main()) != nullptr) + if (subjectLoc.has_value() && (_mainWindow = WindowGetMain()) != nullptr) { - window_scroll_to_location(*_mainWindow, subjectLoc.value()); + WindowScrollToLocation(*_mainWindow, subjectLoc.value()); } } } diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 8b9214e3a3..bfdf29c411 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -384,7 +384,7 @@ private: { selected_list_item = index; } - widget_invalidate(*this, WIDX_SCROLL); + WidgetInvalidate(*this, WIDX_SCROLL); } public: @@ -409,7 +409,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); return; case WIDX_COPY_CURRENT: if (selected_list_item > -1 && selected_list_item < no_list_items) @@ -437,7 +437,7 @@ public: if (!WidgetIsHighlighted(*this, WIDX_SCROLL)) { _highlightedIndex = -1; - widget_invalidate(*this, WIDX_SCROLL); + WidgetInvalidate(*this, WIDX_SCROLL); } #ifndef DISABLE_HTTP @@ -480,7 +480,7 @@ public: else _highlightedIndex = selectedItem; - widget_invalidate(*this, WIDX_SCROLL); + WidgetInvalidate(*this, WIDX_SCROLL); } void OnDraw(rct_drawpixelinfo& dpi) override @@ -564,7 +564,7 @@ public: rct_window* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { // Check if window is already open - auto* window = window_bring_to_front_by_class(WindowClass::ObjectLoadError); + auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError); if (window == nullptr) { window = WindowCreate(WindowClass::ObjectLoadError, WW, WH, 0); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 6e081a6179..79b2060158 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -622,7 +622,7 @@ private: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_TAB_DISPLAY: case WIDX_TAB_RENDERING: @@ -934,7 +934,7 @@ private: gConfigGeneral.AlwaysShowGridlines ^= 1; ConfigSaveDefault(); GfxInvalidateScreen(); - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (gConfigGeneral.AlwaysShowGridlines) @@ -1304,7 +1304,7 @@ private: OpenRCT2::Audio::Pause(); else OpenRCT2::Audio::Resume(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); ConfigSaveDefault(); Invalidate(); break; @@ -1552,43 +1552,43 @@ private: gConfigInterface.ToolbarShowFinances ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_RESEARCH: gConfigInterface.ToolbarShowResearch ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHEATS: gConfigInterface.ToolbarShowCheats ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_NEWS: gConfigInterface.ToolbarShowNews ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_MUTE: gConfigInterface.ToolbarShowMute ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHAT: gConfigInterface.ToolbarShowChat ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_ZOOM: gConfigInterface.ToolbarShowZoom ^= 1; ConfigSaveDefault(); Invalidate(); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case WIDX_INVERT_DRAG: gConfigGeneral.InvertViewportDrag ^= 1; @@ -1682,7 +1682,7 @@ private: case WIDX_SCENARIO_UNLOCKING: gConfigGeneral.ScenarioUnlockingEnabled ^= 1; ConfigSaveDefault(); - window_close_by_class(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::ScenarioSelect); break; case WIDX_AUTO_OPEN_SHOPS: gConfigGeneral.AutoOpenShops = !gConfigGeneral.AutoOpenShops; @@ -1801,7 +1801,7 @@ private: gConfigInterface.ScenarioselectLastTab = 0; ConfigSaveDefault(); Invalidate(); - window_close_by_class(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::ScenarioSelect); } break; } @@ -2047,8 +2047,8 @@ private: widgets = window_options_page_widgets[page]; Invalidate(); - window_event_resize_call(this); - window_event_invalidate_call(this); + WindowEventResizeCall(this); + WindowEventInvalidateCall(this); InitScrollWidgets(); Invalidate(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 7099811c63..629a729bcf 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -210,7 +210,7 @@ public: if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) { - tool_cancel(); + ToolCancel(); } } @@ -437,7 +437,7 @@ private: void OnResizeEntrance() { flags |= WF_RESIZABLE; - window_set_resize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3); + WindowSetResize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3); InitViewport(); } @@ -487,7 +487,7 @@ private: void OnUpdateEntrance() { frame_no++; - widget_invalidate(*this, WIDX_TAB_1); + WidgetInvalidate(*this, WIDX_TAB_1); } void OnTextInputEntrance(WidgetIndex widgetIndex, std::string_view text) @@ -533,7 +533,7 @@ private: else widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::FlatBtn; - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); // Anchor entrance page specific widgets @@ -593,7 +593,7 @@ private: // Draw viewport if (viewport != nullptr) { - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 }); } @@ -632,7 +632,7 @@ private: } // Call invalidate event - window_event_invalidate_call(this); + WindowEventInvalidateCall(this); focus = newFocus; @@ -660,13 +660,13 @@ private: #pragma region Rating page void OnResizeRating() { - window_set_resize(*this, 255, 182, 255, 182); + WindowSetResize(*this, 255, 182, 255, 182); } void OnUpdateRating() { frame_no++; - widget_invalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_2); } void OnPrepareDrawRating() @@ -681,7 +681,7 @@ private: SetPressedTab(); PrepareWindowTitleText(); - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -732,14 +732,14 @@ private: #pragma region Guests page void OnResizeGuests() { - window_set_resize(*this, 255, 182, 255, 182); + WindowSetResize(*this, 255, 182, 255, 182); } void OnUpdateGuests() { frame_no++; _peepAnimationFrame = (_peepAnimationFrame + 1) % 24; - widget_invalidate(*this, WIDX_TAB_3); + WidgetInvalidate(*this, WIDX_TAB_3); } void OnPrepareDrawGuests() @@ -754,7 +754,7 @@ private: SetPressedTab(); PrepareWindowTitleText(); - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -818,7 +818,7 @@ private: #pragma region Price page void OnResizePrice() { - window_set_resize(*this, 230, 124, 230, 124); + WindowSetResize(*this, 230, 124, 230, 124); } void OnMouseDownPrice(WidgetIndex widgetIndex) @@ -845,7 +845,7 @@ private: void OnUpdatePrice() { frame_no++; - widget_invalidate(*this, WIDX_TAB_4); + WidgetInvalidate(*this, WIDX_TAB_4); } void OnPrepareDrawPrice() @@ -884,7 +884,7 @@ private: widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Button; } - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -911,20 +911,20 @@ private: #pragma region Stats page void OnResizeStats() { - window_set_resize(*this, 230, 119, 230, 119); + WindowSetResize(*this, 230, 119, 230, 119); } void OnUpdateStats() { frame_no++; - widget_invalidate(*this, WIDX_TAB_5); + WidgetInvalidate(*this, WIDX_TAB_5); // Invalidate ride count if changed const auto rideCount = ride_get_count(); if (_numberOfRides != rideCount) { _numberOfRides = rideCount; - widget_invalidate(*this, WIDX_PAGE_BACKGROUND); + WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); } // Invalidate number of staff if changed @@ -932,7 +932,7 @@ private: if (_numberOfStaff != staffCount) { _numberOfStaff = staffCount; - widget_invalidate(*this, WIDX_PAGE_BACKGROUND); + WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); } } @@ -948,7 +948,7 @@ private: SetPressedTab(); PrepareWindowTitleText(); - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -1020,16 +1020,16 @@ private: { #ifndef NO_TTF if (gCurrentTTFFontSet != nullptr) - window_set_resize(*this, 230, 270, 230, 270); + WindowSetResize(*this, 230, 270, 230, 270); else #endif - window_set_resize(*this, 230, 226, 230, 226); + WindowSetResize(*this, 230, 226, 230, 226); } void OnUpdateObjective() { frame_no++; - widget_invalidate(*this, WIDX_TAB_6); + WidgetInvalidate(*this, WIDX_TAB_6); } void OnTextInputObjective(WidgetIndex widgetIndex, std::string_view text) @@ -1057,7 +1057,7 @@ private: else widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Empty; - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -1126,13 +1126,13 @@ private: #pragma region Awards page void OnResizeAwards() { - window_set_resize(*this, 230, 182, 230, 182); + WindowSetResize(*this, 230, 182, 230, 182); } void OnUpdateAwards() { frame_no++; - widget_invalidate(*this, WIDX_TAB_7); + WidgetInvalidate(*this, WIDX_TAB_7); } void OnPrepareDrawAwards() @@ -1147,7 +1147,7 @@ private: SetPressedTab(); PrepareWindowTitleText(); - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); AnchorBorderWidgets(); } @@ -1177,7 +1177,7 @@ private: { if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - tool_cancel(); + ToolCancel(); // Set listen only to viewport bool listen = false; @@ -1194,9 +1194,9 @@ private: SetDisabledTabs(); Invalidate(); - window_event_resize_call(this); - window_event_invalidate_call(this); - window_event_update_call(this); + WindowEventResizeCall(this); + WindowEventInvalidateCall(this); + WindowEventUpdateCall(this); if (listen && viewport != nullptr) viewport->flags |= VIEWPORT_FLAG_SOUND_ON; } diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index de3b76bc1e..3ffa51cbb9 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -57,7 +57,7 @@ public: widgets = PatrolAreaWidgets; hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); gLandToolSize = 4; } @@ -65,7 +65,7 @@ public: { // If the tool wasn't changed, turn tool off if (PatrolAreaToolIsActive()) - tool_cancel(); + ToolCancel(); } void OnMouseUp(WidgetIndex widgetIndex) override @@ -244,7 +244,7 @@ private: } else { - if (!tool_set(*this, 0, Tool::WalkDown)) + if (!ToolSet(*this, 0, Tool::WalkDown)) { show_gridlines(); input_set_flag(INPUT_FLAG_6, true); @@ -274,7 +274,7 @@ private: bool IsStaffWindowOpen() { // If staff window for this patrol area was closed, tool is no longer active - auto staffWindow = window_find_by_number(WindowClass::Peep, _staffId); + auto staffWindow = WindowFindByNumber(WindowClass::Peep, _staffId); return staffWindow != nullptr; } @@ -298,6 +298,6 @@ rct_window* WindowPatrolAreaOpen(EntityId staffId) EntityId WindowPatrolAreaGetCurrentStaffId() { - auto current = reinterpret_cast(window_find_by_class(WindowClass::PatrolArea)); + auto current = reinterpret_cast(WindowFindByClass(WindowClass::PatrolArea)); return current != nullptr ? current->GetStaffId() : EntityId::GetNull(); } diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 57ab12aaff..87fb43fad2 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -137,7 +137,7 @@ rct_window* WindowPlayerOpen(uint8_t id) { rct_window* window; - window = window_bring_to_front_by_number(WindowClass::Player, id); + window = WindowBringToFrontByNumber(WindowClass::Player, id); if (window == nullptr) { window = WindowCreateAutoPos(240, 170, &window_player_overview_events, WindowClass::Player, WF_RESIZABLE); @@ -205,7 +205,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -213,7 +213,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex) break; case WIDX_LOCATE: { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { int32_t player = network_get_player_index(static_cast(w->number)); @@ -224,7 +224,7 @@ void WindowPlayerOverviewMouseUp(rct_window* w, WidgetIndex widgetIndex) auto coord = network_get_player_last_action_coord(player); if (coord.x || coord.y || coord.z) { - window_scroll_to_location(*mainWindow, coord); + WindowScrollToLocation(*mainWindow, coord); } } } @@ -266,7 +266,7 @@ void WindowPlayerOverviewDropdown(rct_window* w, WidgetIndex widgetIndex, int32_ playerSetGroupAction.SetCallback([windowHandle](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - window_invalidate_by_number(windowHandle.first, windowHandle.second); + WindowInvalidateByNumber(windowHandle.first, windowHandle.second); } }); GameActions::Execute(&playerSetGroupAction); @@ -274,17 +274,17 @@ void WindowPlayerOverviewDropdown(rct_window* w, WidgetIndex widgetIndex, int32_ void WindowPlayerOverviewResize(rct_window* w) { - window_set_resize(*w, 240, 170, 500, 300); + WindowSetResize(*w, 240, 170, 500, 300); } void WindowPlayerOverviewUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB_1 + w->page); + WidgetInvalidate(*w, WIDX_TAB_1 + w->page); if (network_get_player_index(static_cast(w->number)) == -1) { - window_close(*w); + WindowClose(*w); return; } @@ -355,7 +355,7 @@ void WindowPlayerOverviewPaint(rct_window* w, rct_drawpixelinfo* dpi) if (w->viewport != nullptr && w->var_492 != -1) { - window_draw_viewport(dpi, *w); + WindowDrawViewport(dpi, *w); } } @@ -393,7 +393,7 @@ void WindowPlayerOverviewInvalidate(rct_window* w) w->widgets[WIDX_GROUP_DROPDOWN].left = w->widgets[WIDX_GROUP].right - 10; w->widgets[WIDX_GROUP_DROPDOWN].right = w->widgets[WIDX_GROUP].right; - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_2); rct_viewport* viewport = w->viewport; if (viewport != nullptr) @@ -427,7 +427,7 @@ void WindowPlayerStatisticsMouseUp(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -438,17 +438,17 @@ void WindowPlayerStatisticsMouseUp(rct_window* w, WidgetIndex widgetIndex) void WindowPlayerStatisticsResize(rct_window* w) { - window_set_resize(*w, 210, 80, 210, 80); + WindowSetResize(*w, 210, 80, 210, 80); } void WindowPlayerStatisticsUpdate(rct_window* w) { w->frame_no++; - widget_invalidate(*w, WIDX_TAB_1 + w->page); + WidgetInvalidate(*w, WIDX_TAB_1 + w->page); if (network_get_player_index(static_cast(w->number)) == -1) { - window_close(*w); + WindowClose(*w); } } @@ -468,7 +468,7 @@ void WindowPlayerStatisticsInvalidate(rct_window* w) w->ResizeFrameWithPage(); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_2); } void WindowPlayerStatisticsPaint(rct_window* w, rct_drawpixelinfo* dpi) @@ -511,8 +511,8 @@ static void WindowPlayerSetPage(rct_window* w, int32_t page) w->pressed_widgets = 0; w->widgets = window_player_page_widgets[page]; w->Invalidate(); - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); @@ -523,12 +523,12 @@ static void WindowPlayerSetPage(rct_window* w, int32_t page) const auto focus = Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); viewport_create(w, w->windowPos, w->width, w->height, focus); w->flags |= WF_NO_SCROLLING; - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); WindowPlayerUpdateViewport(w, false); } else if (originalPage != page) { - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); WindowPlayerUpdateViewport(w, false); } } @@ -599,7 +599,7 @@ static void WindowPlayerUpdateViewport(rct_window* w, bool scroll) { w->viewport->viewPos = centreLoc.value(); } - widget_invalidate(*w, WIDX_VIEWPORT); + WidgetInvalidate(*w, WIDX_VIEWPORT); } // Draw the viewport diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index d876b4701a..1acc024774 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -96,11 +96,11 @@ rct_window* WindowRideRefurbishPromptOpen(const Ride& ride) rct_window* w; RefurbishRidePromptWindow* newWindow; - w = window_find_by_class(WindowClass::DemolishRidePrompt); + w = WindowFindByClass(WindowClass::DemolishRidePrompt); if (w != nullptr) { auto windowPos = w->windowPos; - window_close(*w); + WindowClose(*w); newWindow = WindowCreate(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } else diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 9944abafb8..dec884bbb7 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -162,7 +162,7 @@ rct_window* WindowResearchOpen() { rct_window* w; - w = window_bring_to_front_by_class(WindowClass::Research); + w = WindowBringToFrontByClass(WindowClass::Research); if (w == nullptr) { w = WindowCreateAutoPos(WW_FUNDING, WH_FUNDING, window_research_page_events[0], WindowClass::Research, WF_10); @@ -201,7 +201,7 @@ static void WindowResearchDevelopmentMouseup(rct_window* w, WidgetIndex widgetIn switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -222,7 +222,7 @@ static void WindowResearchDevelopmentUpdate(rct_window* w) // Tab animation if (++w->frame_no >= window_research_tab_animation_loops[w->page]) w->frame_no = 0; - widget_invalidate(*w, WIDX_TAB_1); + WidgetInvalidate(*w, WIDX_TAB_1); } /** @@ -396,7 +396,7 @@ static void WindowResearchFundingMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -465,7 +465,7 @@ static void WindowResearchFundingUpdate(rct_window* w) // Tab animation if (++w->frame_no >= window_research_tab_animation_loops[w->page]) w->frame_no = 0; - widget_invalidate(*w, WIDX_TAB_2); + WidgetInvalidate(*w, WIDX_TAB_2); } /** @@ -578,8 +578,8 @@ static void WindowResearchSetPage(rct_window* w, int32_t page) w->width = WW_FUNDING; w->height = WH_FUNDING; } - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index ea18b19e26..e1ec4b22e3 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1192,7 +1192,7 @@ rct_window* WindowRideMainOpen(const Ride& ride) return nullptr; } - rct_window* w = window_bring_to_front_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + rct_window* w = WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying()); if (w == nullptr) { w = WindowRideOpen(ride); @@ -1208,7 +1208,7 @@ rct_window* WindowRideMainOpen(const Ride& ride) { if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number) { - tool_cancel(); + ToolCancel(); } } @@ -1233,7 +1233,7 @@ static rct_window* WindowRideOpenStation(const Ride& ride, StationIndex stationI if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) return WindowRideMainOpen(ride); - auto w = window_bring_to_front_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + auto w = WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying()); if (w == nullptr) { w = WindowRideOpen(ride); @@ -1243,7 +1243,7 @@ static rct_window* WindowRideOpenStation(const Ride& ride, StationIndex stationI if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification && gCurrentToolWidget.window_number == w->number) { - tool_cancel(); + ToolCancel(); } w->page = WINDOW_RIDE_PAGE_MAIN; @@ -1338,7 +1338,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle) view++; } - rct_window* w = window_find_by_number(WindowClass::Ride, ride->id.ToUnderlying()); + rct_window* w = WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying()); if (w != nullptr) { w->Invalidate(); @@ -1346,7 +1346,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle) if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification && gCurrentToolWidget.window_number == w->number) { - tool_cancel(); + ToolCancel(); } int32_t openedPeepWindow = 0; @@ -1360,7 +1360,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle) continue; numPeepsLeft--; - rct_window* w2 = window_find_by_number(WindowClass::Peep, vehicle->peep[i]); + rct_window* w2 = WindowFindByNumber(WindowClass::Peep, vehicle->peep[i]); if (w2 == nullptr) { auto intent = Intent(WindowClass::Peep); @@ -1373,8 +1373,8 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle) } } - w = openedPeepWindow ? window_find_by_number(WindowClass::Ride, ride->id.ToUnderlying()) - : window_bring_to_front_by_number(WindowClass::Ride, ride->id.ToUnderlying()); + w = openedPeepWindow ? WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying()) + : WindowBringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying()); } if (w == nullptr) @@ -1412,14 +1412,14 @@ static void WindowRideSetPage(rct_window* w, int32_t page) if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number) - tool_cancel(); + ToolCancel(); if (page == WINDOW_RIDE_PAGE_VEHICLE) { - auto constructionWindow = window_find_by_class(WindowClass::RideConstruction); + auto constructionWindow = WindowFindByClass(WindowClass::RideConstruction); if (constructionWindow != nullptr && constructionWindow->number == w->number) { - window_close_by_class(WindowClass::RideConstruction); + WindowCloseByClass(WindowClass::RideConstruction); // Closing the construction window sets the tab to the first page, which we don't want here, // as user just clicked the Vehicle page WindowRideSetPage(w, WINDOW_RIDE_PAGE_VEHICLE); @@ -1449,8 +1449,8 @@ static void WindowRideSetPage(rct_window* w, int32_t page) WindowRideDisableTabs(w); w->Invalidate(); - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); @@ -1571,7 +1571,7 @@ static void WindowRideInitViewport(rct_window* w) viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); w->focus = focus; @@ -1620,7 +1620,7 @@ static void WindowRideMainMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -1640,9 +1640,9 @@ static void WindowRideMainMouseup(rct_window* w, WidgetIndex widgetIndex) if (ride != nullptr) { RideConstructionStart(*ride); - if (window_find_by_number(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr) + if (WindowFindByNumber(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr) { - window_close(*w); + WindowClose(*w); } } break; @@ -1718,7 +1718,7 @@ static void WindowRideMainResize(rct_window* w) } w->flags |= WF_RESIZABLE; - window_set_resize(*w, 316, minHeight, 500, 450); + WindowSetResize(*w, 316, minHeight, 500, 450); // Unlike with other windows, the focus needs to be recentred so it’s best to just reset it. w->focus = std::nullopt; WindowRideInitViewport(w); @@ -1977,8 +1977,8 @@ static void WindowRideMainFollowRide(rct_window* w) if (vehicle != nullptr) { auto headVehicleSpriteIndex = vehicle->sprite_index; - rct_window* w_main = window_get_main(); - window_follow_sprite(*w_main, headVehicleSpriteIndex); + rct_window* w_main = WindowGetMain(); + WindowFollowSprite(*w_main, headVehicleSpriteIndex); } } } @@ -2218,8 +2218,8 @@ static void WindowRideMainUpdate(rct_window* w) { // Update tab animation w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_1); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_1); // Update status auto ride = get_ride(w->rideId); @@ -2245,7 +2245,7 @@ static void WindowRideMainUpdate(rct_window* w) } ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAIN; } - widget_invalidate(*w, WIDX_STATUS); + WidgetInvalidate(*w, WIDX_STATUS); } /** @@ -2364,7 +2364,7 @@ static void WindowRideMainInvalidate(rct_window* w) window_ride_main_widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button; } - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) { @@ -2569,7 +2569,7 @@ static void WindowRideMainPaint(rct_window* w, rct_drawpixelinfo* dpi) // Viewport and ear icon if (w->viewport != nullptr) { - window_draw_viewport(dpi, *w); + WindowDrawViewport(dpi, *w); if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON) GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 }); } @@ -2625,7 +2625,7 @@ static void WindowRideVehicleMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -2648,7 +2648,7 @@ static void WindowRideVehicleMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideVehicleResize(rct_window* w) { - window_set_resize(*w, 316, 214, 316, 214); + WindowSetResize(*w, 316, 214, 316, 214); } /** @@ -2717,8 +2717,8 @@ static void WindowRideVehicleDropdown(rct_window* w, WidgetIndex widgetIndex, in static void WindowRideVehicleUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_2); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_2); } static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const WidgetIndex widgetIndex, StringId fallback) @@ -2849,7 +2849,7 @@ static void WindowRideVehicleInvalidate(rct_window* w) ride->FormatNameTo(ft); WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1) { @@ -3156,7 +3156,7 @@ static void WindowRideOperatingMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -3196,7 +3196,7 @@ static void WindowRideOperatingMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideOperatingResize(rct_window* w) { - window_set_resize(*w, 316, 186, 316, 186); + WindowSetResize(*w, 316, 186, 316, 186); } /** @@ -3395,8 +3395,8 @@ static void WindowRideOperatingDropdown(rct_window* w, WidgetIndex widgetIndex, static void WindowRideOperatingUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_3); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_3); auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) @@ -3695,7 +3695,7 @@ static void WindowRideOperatingInvalidate(rct_window* w) } WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -3791,7 +3791,7 @@ static void WindowRideMaintenanceMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -3820,7 +3820,7 @@ static void WindowRideMaintenanceMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideMaintenanceResize(rct_window* w) { - window_set_resize(*w, 316, 135, 316, 135); + WindowSetResize(*w, 316, 135, 316, 135); } /** @@ -3986,7 +3986,7 @@ static void WindowRideMaintenanceDropdown(rct_window* w, WidgetIndex widgetIndex break; } ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); - window_invalidate_by_number(WindowClass::Ride, w->number); + WindowInvalidateByNumber(WindowClass::Ride, w->number); break; } if (ride->lifecycle_flags @@ -4036,8 +4036,8 @@ static void WindowRideMaintenanceDropdown(rct_window* w, WidgetIndex widgetIndex static void WindowRideMaintenanceUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_4); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_4); auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) @@ -4072,7 +4072,7 @@ static void WindowRideMaintenanceInvalidate(rct_window* w) window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[ride->inspection_interval]; WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); if (gConfigGeneral.DebuggingTools && network_get_mode() == NETWORK_MODE_NONE) { @@ -4281,7 +4281,7 @@ static void WindowRideColourClose(rct_window* w) if (gCurrentToolWidget.window_number != w->number) return; - tool_cancel(); + ToolCancel(); } /** @@ -4293,7 +4293,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -4308,7 +4308,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex) WindowRideSetPage(w, widgetIndex - WIDX_TAB_1); break; case WIDX_PAINT_INDIVIDUAL_AREA: - tool_set(*w, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown); + ToolSet(*w, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown); break; case WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX: auto ride = get_ride(w->rideId); @@ -4329,7 +4329,7 @@ static void WindowRideColourMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideColourResize(rct_window* w) { - window_set_resize(*w, 316, 207, 316, 207); + WindowSetResize(*w, 316, 207, 316, 207); } /** @@ -4579,9 +4579,9 @@ static void WindowRideColourDropdown(rct_window* w, WidgetIndex widgetIndex, int static void WindowRideColourUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_5); - widget_invalidate(*w, WIDX_VEHICLE_PREVIEW); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_5); + WidgetInvalidate(*w, WIDX_VEHICLE_PREVIEW); } /** @@ -4851,7 +4851,7 @@ static void WindowRideColourInvalidate(rct_window* w) ft.Add(ColourSchemeNames[colourScheme]); WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -5044,7 +5044,7 @@ static void WindowRideMusicMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -5071,7 +5071,7 @@ static void WindowRideMusicMouseup(rct_window* w, WidgetIndex widgetIndex) static void WindowRideMusicResize(rct_window* w) { w->flags |= WF_RESIZABLE; - window_set_resize(*w, 316, 81, 316, 81); + WindowSetResize(*w, 316, 81, 316, 81); } static std::string GetMusicString(ObjectEntryIndex musicObjectIndex) @@ -5182,8 +5182,8 @@ static void WindowRideMusicDropdown(rct_window* w, WidgetIndex widgetIndex, int3 static void WindowRideMusicUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_6); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_6); } /** @@ -5234,7 +5234,7 @@ static void WindowRideMusicInvalidate(rct_window* w) } WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -5267,14 +5267,14 @@ static void CancelScenerySelection() gTrackDesignSaveMode = false; OpenRCT2::Audio::Resume(); - rct_window* main_w = window_get_main(); + rct_window* main_w = WindowGetMain(); if (main_w != nullptr) { main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); } GfxInvalidateScreen(); - tool_cancel(); + ToolCancel(); } /** @@ -5288,7 +5288,7 @@ static void SetupScenerySelection(rct_window* w) CancelScenerySelection(); } - while (tool_set(*w, WIDX_BACKGROUND, Tool::Crosshair)) + while (ToolSet(*w, WIDX_BACKGROUND, Tool::Crosshair)) ; gTrackDesignSaveRideIndex = w->rideId; @@ -5299,7 +5299,7 @@ static void SetupScenerySelection(rct_window* w) OpenRCT2::Audio::StopAll(); - rct_window* w_main = window_get_main(); + rct_window* w_main = WindowGetMain(); if (w_main != nullptr) { w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); @@ -5404,7 +5404,7 @@ static void WindowRideMeasurementsMouseup(rct_window* w, WidgetIndex widgetIndex switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -5439,7 +5439,7 @@ static void WindowRideMeasurementsMouseup(rct_window* w, WidgetIndex widgetIndex */ static void WindowRideMeasurementsResize(rct_window* w) { - window_set_resize(*w, 316, 234, 316, 234); + WindowSetResize(*w, 316, 234, 316, 234); } /** @@ -5497,8 +5497,8 @@ static void WindowRideMeasurementsDropdown(rct_window* w, WidgetIndex widgetInde static void WindowRideMeasurementsUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_7); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_7); } /** @@ -5614,7 +5614,7 @@ static void WindowRideMeasurementsInvalidate(rct_window* w) } WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -5897,7 +5897,7 @@ static void WindowRideGraphsMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -5920,7 +5920,7 @@ static void WindowRideGraphsMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideGraphsResize(rct_window* w) { - window_set_resize(*w, 316, 182, 500, 450); + WindowSetResize(*w, 316, 182, 500, 450); } /** @@ -5956,10 +5956,10 @@ static void WindowRideGraphsUpdate(rct_window* w) int32_t x; w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_8); - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_GRAPH); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_8); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_GRAPH); widget = &window_ride_graphs_widgets[WIDX_GRAPH]; x = w->scrolls[0].h_left; @@ -5984,7 +5984,7 @@ static void WindowRideGraphsUpdate(rct_window* w) */ static void WindowRideGraphsScrollgetheight(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) { - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); // Set minimum size *width = window_ride_graphs_widgets[WIDX_GRAPH].width() - 2; @@ -6101,7 +6101,7 @@ static void WindowRideGraphsInvalidate(rct_window* w) window_ride_graphs_widgets[WIDX_GRAPH_LATERAL].bottom = y; WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -6486,7 +6486,7 @@ static void WindowRideIncomeMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -6539,7 +6539,7 @@ static void WindowRideIncomeMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowRideIncomeResize(rct_window* w) { - window_set_resize(*w, 316, 194, 316, 194); + WindowSetResize(*w, 316, 194, 316, 194); } /** @@ -6572,8 +6572,8 @@ static void WindowRideIncomeMousedown(rct_window* w, WidgetIndex widgetIndex, Wi static void WindowRideIncomeUpdate(rct_window* w) { w->frame_no++; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_9); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_9); auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) @@ -6718,7 +6718,7 @@ static void WindowRideIncomeInvalidate(rct_window* w) } WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } /** @@ -6838,7 +6838,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -6886,7 +6886,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex) static void WindowRideCustomerResize(rct_window* w) { w->flags |= WF_RESIZABLE; - window_set_resize(*w, 316, 163, 316, 163); + WindowSetResize(*w, 316, 163, 316, 163); } /** @@ -6899,8 +6899,8 @@ static void WindowRideCustomerUpdate(rct_window* w) if (w->picked_peep_frame >= 24) w->picked_peep_frame = 0; - window_event_invalidate_call(w); - widget_invalidate(*w, WIDX_TAB_10); + WindowEventInvalidateCall(w); + WidgetInvalidate(*w, WIDX_TAB_10); auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) @@ -6944,7 +6944,7 @@ static void WindowRideCustomerInvalidate(rct_window* w) } WindowRideAnchorBorderWidgets(w); - window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); + WindowAlignTabs(w, WIDX_TAB_1, WIDX_TAB_10); } } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 15db688dc4..9df7579f79 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -179,9 +179,9 @@ static int32_t RideGetAlternativeType(const Ride& ride) /* move to ride.c */ static void CloseRideWindowForConstruction(RideId rideId) { - rct_window* w = window_find_by_number(WindowClass::Ride, rideId.ToUnderlying()); + rct_window* w = WindowFindByNumber(WindowClass::Ride, rideId.ToUnderlying()); if (w != nullptr && w->page == 1) - window_close(*w); + WindowClose(*w); } static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); @@ -212,7 +212,7 @@ public: InitScrollWidgets(); - window_push_others_right(*this); + WindowPushOthersRight(*this); show_gridlines(); _currentTrackPrice = MONEY32_UNDEFINED; @@ -253,7 +253,7 @@ public: // selection tool should be cancelled. Don't do a tool cancel if // another window has already taken control of tool. if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - tool_cancel(); + ToolCancel(); hide_gridlines(); @@ -802,7 +802,7 @@ public: if (_rideConstructionState == RideConstructionState::Front) { disabledWidgets |= (1uLL << WIDX_NEXT_SECTION); - if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) + if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } @@ -810,7 +810,7 @@ public: else if (_rideConstructionState == RideConstructionState::Back) { disabledWidgets |= (1uLL << WIDX_PREVIOUS_SECTION); - if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) + if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } @@ -854,7 +854,7 @@ public: { if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) { - widget_invalidate(*this, i); + WidgetInvalidate(*this, i); } } disabled_widgets = disabledWidgets; @@ -882,7 +882,7 @@ public: case TrackElemType::Whirlpool | RideConstructionSpecialPieceSelected: case TrackElemType::Rapids | RideConstructionSpecialPieceSelected: case TrackElemType::Waterfall | RideConstructionSpecialPieceSelected: - widget_invalidate(*this, WIDX_CONSTRUCT); + WidgetInvalidate(*this, WIDX_CONSTRUCT); break; } @@ -912,7 +912,7 @@ public: if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) { - tool_cancel(); + ToolCancel(); } break; default: @@ -1403,11 +1403,11 @@ public: switch (widgetIndex) { case WIDX_CONSTRUCT: - ride_construction_toolupdate_construct(screenCoords); + RideConstructionToolupdateConstruct(screenCoords); break; case WIDX_ENTRANCE: case WIDX_EXIT: - ride_construction_toolupdate_entrance_exit(screenCoords); + RideConstructionToolupdateEntranceExit(screenCoords); break; } } @@ -1417,7 +1417,7 @@ public: switch (widgetIndex) { case WIDX_CONSTRUCT: - ride_construction_tooldown_construct(screenCoords); + RideConstructionTooldownConstruct(screenCoords); break; case WIDX_ENTRANCE: case WIDX_EXIT: @@ -1497,7 +1497,7 @@ public: RideId rideIndex; int32_t trackType, trackDirection, liftHillAndInvertedState; - if (window_ride_construction_update_state( + if (WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr)) return; @@ -2167,7 +2167,7 @@ public: gMapSelectionTiles.clear(); return; default: - if (window_ride_construction_update_state(&trackType, &trackDirection, nullptr, nullptr, &trackPos, nullptr)) + if (WindowRideConstructionUpdateState(&trackType, &trackDirection, nullptr, nullptr, &trackPos, nullptr)) { trackDirection = _currentTrackPieceDirection; trackType = 0; @@ -2187,7 +2187,7 @@ public: { // If the scenery tool is active, we do not display our tiles as it // will conflict with larger scenery objects selecting tiles - if (scenery_tool_is_active()) + if (SceneryToolIsActive()) { return; } @@ -2224,7 +2224,7 @@ private: _trackPlaceCost = MONEY32_UNDEFINED; _trackPlaceErrorMessage = STR_NONE; ride_construction_invalidate_current_track(); - if (window_ride_construction_update_state( + if (WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, &properties)) { window_ride_construction_update_active_elements(); @@ -2409,7 +2409,7 @@ private: void EntranceClick() { - if (tool_set(*this, WIDX_ENTRANCE, Tool::Crosshair)) + if (ToolSet(*this, WIDX_ENTRANCE, Tool::Crosshair)) { auto currentRide = get_ride(_currentRideIndex); if (currentRide != nullptr && !ride_try_get_origin_element(*currentRide, nullptr)) @@ -2435,7 +2435,7 @@ private: void ExitClick() { - if (tool_set(*this, WIDX_EXIT, Tool::Crosshair)) + if (ToolSet(*this, WIDX_EXIT, Tool::Crosshair)) { auto currentRide = get_ride(_currentRideIndex); if (!ride_try_get_origin_element(*currentRide, nullptr)) @@ -2571,16 +2571,16 @@ private: auto currentRide = get_ride(gRideEntranceExitPlaceRideIndex); if (currentRide != nullptr && ride_are_all_possible_entrances_and_exits_built(*currentRide).Successful) { - tool_cancel(); + ToolCancel(); if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) { - window_close_by_class(WindowClass::RideConstruction); + WindowCloseByClass(WindowClass::RideConstruction); } } else { gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; - window_invalidate_by_class(WindowClass::RideConstruction); + WindowInvalidateByClass(WindowClass::RideConstruction); gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE : WC_RIDE_CONSTRUCTION__WIDX_EXIT; @@ -2792,16 +2792,16 @@ static void CloseConstructWindowOnCompletion(const Ride& ride) { if (_rideConstructionState == RideConstructionState::State0) { - auto w = window_find_by_class(WindowClass::RideConstruction); + auto w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr) { if (ride_are_all_possible_entrances_and_exits_built(ride).Successful) { - window_close(*w); + WindowClose(*w); } else { - window_event_mouse_up_call(w, WIDX_ENTRANCE); + WindowEventMouseUpCall(w, WIDX_ENTRANCE); } } } @@ -2809,7 +2809,7 @@ static void CloseConstructWindowOnCompletion(const Ride& ride) static void window_ride_construction_do_entrance_exit_check() { - auto w = window_find_by_class(WindowClass::RideConstruction); + auto w = WindowFindByClass(WindowClass::RideConstruction); auto ride = get_ride(_currentRideIndex); if (w == nullptr || ride == nullptr) { @@ -2818,12 +2818,12 @@ static void window_ride_construction_do_entrance_exit_check() if (_rideConstructionState == RideConstructionState::State0) { - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr) { if (!ride_are_all_possible_entrances_and_exits_built(*ride).Successful) { - window_event_mouse_up_call(w, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + WindowEventMouseUpCall(w, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); } } } @@ -2869,7 +2869,7 @@ static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, c window_ride_construction_update_active_elements(); } - window_close_by_class(WindowClass::Error); + WindowCloseByClass(WindowClass::Error); if (ride != nullptr) CloseConstructWindowOnCompletion(*ride); } @@ -2913,7 +2913,7 @@ static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, window_ride_construction_update_active_elements(); } - window_close_by_class(WindowClass::Error); + WindowCloseByClass(WindowClass::Error); if (ride != nullptr) CloseConstructWindowOnCompletion(*ride); } @@ -2963,7 +2963,7 @@ static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoor _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; // Scale delta by zoom to match mouse position. - auto* mainWnd = window_get_main(); + auto* mainWnd = WindowGetMain(); if (mainWnd != nullptr && mainWnd->viewport != nullptr) { _trackPlaceShiftZ = mainWnd->viewport->zoom.ApplyTo(_trackPlaceShiftZ); @@ -3038,7 +3038,7 @@ void WindowRideConstructionUpdateActiveElementsImpl() return; } - auto window = static_cast(window_find_by_class(WindowClass::RideConstruction)); + auto window = static_cast(WindowFindByClass(WindowClass::RideConstruction)); if (!window) { return; @@ -3115,14 +3115,14 @@ void UpdateGhostTrackAndArrow() // place ghost piece if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) { - if (window_ride_construction_update_state( + if (WindowRideConstructionUpdateState( &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) { ride_construction_remove_ghosts(); } else { - _currentTrackPrice = place_provisional_track_piece( + _currentTrackPrice = PlaceProvisionalTrackPiece( rideIndex, type, direction, liftHillAndAlternativeState, trackPos); window_ride_construction_update_active_elements(); } @@ -3209,7 +3209,7 @@ void UpdateGhostTrackAndArrow() * * rct2: 0x006CC6A8 */ -void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) +void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords) { int32_t z; const rct_preview_track* trackBlock; @@ -3240,7 +3240,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) RideId rideIndex; int32_t trackType, trackDirection, liftHillAndAlternativeState; - if (window_ride_construction_update_state( + if (WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) { ride_construction_invalidate_current_track(); @@ -3257,7 +3257,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) const auto& rtd = ride->GetRideTypeDescriptor(); if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) { - auto window = static_cast(window_find_by_class(WindowClass::RideConstruction)); + auto window = static_cast(WindowFindByClass(WindowClass::RideConstruction)); if (!window) { return; @@ -3318,9 +3318,9 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) for (int zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { CoordsXYZ trackPos{}; - window_ride_construction_update_state( + WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); - _currentTrackPrice = place_provisional_track_piece( + _currentTrackPrice = PlaceProvisionalTrackPiece( rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); if (_currentTrackPrice != MONEY32_UNDEFINED) break; @@ -3341,9 +3341,9 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) for (int zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { CoordsXYZ trackPos{}; - window_ride_construction_update_state( + WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); - _currentTrackPrice = place_provisional_track_piece( + _currentTrackPrice = PlaceProvisionalTrackPiece( rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); mapCoords = trackPos; z = trackPos.z; @@ -3414,9 +3414,9 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) _currentTrackPieceDirection = i; CoordsXYZ trackPos{}; - window_ride_construction_update_state( + WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); - place_provisional_track_piece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); + PlaceProvisionalTrackPiece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); gMapSelectArrowDirection = _currentTrackPieceDirection; break; } @@ -3432,7 +3432,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) * * rct2: 0x006CD354 */ -void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords) +void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords) { MapInvalidateSelectionRect(); MapInvalidateMapSelectionTiles(); @@ -3473,7 +3473,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor * * rct2: 0x006CCA73 */ -void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) +void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords) { const CursorState* state = ContextGetCursorState(); @@ -3485,7 +3485,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) CoordsXYZ mapCoords{}; int32_t trackType, z, highestZ; - if (window_ride_construction_update_state(&trackType, nullptr, nullptr, nullptr, nullptr, nullptr)) + if (WindowRideConstructionUpdateState(&trackType, nullptr, nullptr, nullptr, nullptr, nullptr)) return; z = mapCoords.z; @@ -3519,7 +3519,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (z == 0) z = MapGetHighestZ(mapCoords); - tool_cancel(); + ToolCancel(); auto ride = get_ride(_currentRideIndex); if (ride == nullptr) @@ -3563,7 +3563,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) _currentTrackSelectionFlags = 0; auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); ContextBroadcastIntent(&intent); - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr) break; @@ -3596,10 +3596,10 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) || zAttempts == (numAttempts - 1) || z < 0) { OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr) { - tool_set(*w, WIDX_CONSTRUCT, Tool::Crosshair); + ToolSet(*w, WIDX_CONSTRUCT, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); _trackPlaceCtrlState = false; _trackPlaceShiftState = false; @@ -3612,7 +3612,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) } else { - window_close_by_class(WindowClass::Error); + WindowCloseByClass(WindowClass::Error); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, _currentTrackBegin); break; } @@ -3628,12 +3628,12 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) _currentTrackBegin.z = z; _currentTrackSelectionFlags = 0; window_ride_construction_update_active_elements(); - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr) break; gDisableErrorWindowSound = true; - window_event_mouse_up_call(w, WIDX_CONSTRUCT); + WindowEventMouseUpCall(w, WIDX_CONSTRUCT); gDisableErrorWindowSound = false; if (_trackPlaceCost == MONEY32_UNDEFINED) @@ -3679,9 +3679,9 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) } } -void window_ride_construction_keyboard_shortcut_turn_left() +void WindowRideConstructionKeyboardShortcutTurnLeft() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { return; @@ -3693,20 +3693,20 @@ void window_ride_construction_keyboard_shortcut_turn_left() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } break; case TRACK_CURVE_LEFT: if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3716,19 +3716,19 @@ void window_ride_construction_keyboard_shortcut_turn_left() case TRACK_CURVE_LEFT_LARGE: if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3739,23 +3739,23 @@ void window_ride_construction_keyboard_shortcut_turn_left() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3765,29 +3765,29 @@ void window_ride_construction_keyboard_shortcut_turn_left() case TRACK_CURVE_RIGHT_LARGE: if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3798,33 +3798,33 @@ void window_ride_construction_keyboard_shortcut_turn_left() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3834,39 +3834,39 @@ void window_ride_construction_keyboard_shortcut_turn_left() case TRACK_CURVE_RIGHT_SMALL: if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3877,43 +3877,43 @@ void window_ride_construction_keyboard_shortcut_turn_left() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3925,9 +3925,9 @@ void window_ride_construction_keyboard_shortcut_turn_left() } } -void window_ride_construction_keyboard_shortcut_turn_right() +void WindowRideConstructionKeyboardShortcutTurnRight() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { return; @@ -3939,20 +3939,20 @@ void window_ride_construction_keyboard_shortcut_turn_right() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } break; case TRACK_CURVE_RIGHT: if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3962,19 +3962,19 @@ void window_ride_construction_keyboard_shortcut_turn_right() case TRACK_CURVE_RIGHT_LARGE: if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3985,23 +3985,23 @@ void window_ride_construction_keyboard_shortcut_turn_right() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4011,29 +4011,29 @@ void window_ride_construction_keyboard_shortcut_turn_right() case TRACK_CURVE_LEFT_LARGE: if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4044,33 +4044,33 @@ void window_ride_construction_keyboard_shortcut_turn_right() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4080,39 +4080,39 @@ void window_ride_construction_keyboard_shortcut_turn_right() case TRACK_CURVE_LEFT_SMALL: if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4123,43 +4123,43 @@ void window_ride_construction_keyboard_shortcut_turn_right() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEFT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_LARGE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_RIGHT_CURVE_VERY_SMALL); + WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4171,9 +4171,9 @@ void window_ride_construction_keyboard_shortcut_turn_right() } } -void window_ride_construction_keyboard_shortcut_use_track_default() +void WindowRideConstructionKeyboardShortcutUseTrackDefault() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { return; @@ -4181,29 +4181,29 @@ void window_ride_construction_keyboard_shortcut_use_track_default() if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_STRAIGHT); } if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEVEL); + WindowEventMouseDownCall(w, WIDX_LEVEL); } if (!WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) && w->widgets[WIDX_CHAIN_LIFT].type != WindowWidgetType::Empty && _currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) { - window_event_mouse_down_call(w, WIDX_CHAIN_LIFT); + WindowEventMouseDownCall(w, WIDX_CHAIN_LIFT); } if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); } } -void window_ride_construction_keyboard_shortcut_slope_down() +void WindowRideConstructionKeyboardShortcutSlopeDown() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { return; @@ -4216,20 +4216,20 @@ void window_ride_construction_keyboard_shortcut_slope_down() && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } break; case TRACK_SLOPE_DOWN_25: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } break; case TRACK_SLOPE_NONE: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4241,7 +4241,7 @@ void window_ride_construction_keyboard_shortcut_slope_down() !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } else { @@ -4251,17 +4251,17 @@ void window_ride_construction_keyboard_shortcut_slope_down() case TRACK_SLOPE_UP_25: if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEVEL); + WindowEventMouseDownCall(w, WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); } else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } else { @@ -4271,15 +4271,15 @@ void window_ride_construction_keyboard_shortcut_slope_down() case TRACK_SLOPE_UP_60: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP); } else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEVEL); + WindowEventMouseDownCall(w, WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4291,7 +4291,7 @@ void window_ride_construction_keyboard_shortcut_slope_down() !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } else { @@ -4303,7 +4303,7 @@ void window_ride_construction_keyboard_shortcut_slope_down() && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } break; default: @@ -4311,9 +4311,9 @@ void window_ride_construction_keyboard_shortcut_slope_down() } } -void window_ride_construction_keyboard_shortcut_slope_up() +void WindowRideConstructionKeyboardShortcutSlopeUp() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { return; @@ -4326,19 +4326,19 @@ void window_ride_construction_keyboard_shortcut_slope_up() && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } break; case TRACK_SLOPE_UP_25: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } break; case TRACK_SLOPE_NONE: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4349,7 +4349,7 @@ void window_ride_construction_keyboard_shortcut_slope_up() else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } else { @@ -4359,16 +4359,16 @@ void window_ride_construction_keyboard_shortcut_slope_up() case TRACK_SLOPE_DOWN_25: if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEVEL); + WindowEventMouseDownCall(w, WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP); } else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } else { @@ -4378,15 +4378,15 @@ void window_ride_construction_keyboard_shortcut_slope_up() case TRACK_SLOPE_DOWN_60: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); } else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_LEVEL); + WindowEventMouseDownCall(w, WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4397,7 +4397,7 @@ void window_ride_construction_keyboard_shortcut_slope_up() else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_UP_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); } else { @@ -4409,7 +4409,7 @@ void window_ride_construction_keyboard_shortcut_slope_up() && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_SLOPE_DOWN_STEEP); + WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); } break; default: @@ -4417,20 +4417,20 @@ void window_ride_construction_keyboard_shortcut_slope_up() } } -void window_ride_construction_keyboard_shortcut_chain_lift_toggle() +void WindowRideConstructionKeyboardShortcutChainLiftToggle() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) || w->widgets[WIDX_CHAIN_LIFT].type == WindowWidgetType::Empty) { return; } - window_event_mouse_down_call(w, WIDX_CHAIN_LIFT); + WindowEventMouseDownCall(w, WIDX_CHAIN_LIFT); } -void window_ride_construction_keyboard_shortcut_bank_left() +void WindowRideConstructionKeyboardShortcutBankLeft() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4442,17 +4442,17 @@ void window_ride_construction_keyboard_shortcut_bank_left() case TRACK_BANK_NONE: if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_LEFT); + WindowEventMouseDownCall(w, WIDX_BANK_LEFT); } break; case TRACK_BANK_RIGHT: if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); } else if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_LEFT); + WindowEventMouseDownCall(w, WIDX_BANK_LEFT); } else { @@ -4464,9 +4464,9 @@ void window_ride_construction_keyboard_shortcut_bank_left() } } -void window_ride_construction_keyboard_shortcut_bank_right() +void WindowRideConstructionKeyboardShortcutBankRight() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4478,17 +4478,17 @@ void window_ride_construction_keyboard_shortcut_bank_right() case TRACK_BANK_NONE: if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_RIGHT); + WindowEventMouseDownCall(w, WIDX_BANK_RIGHT); } break; case TRACK_BANK_LEFT: if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_STRAIGHT); + WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); } else if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) { - window_event_mouse_down_call(w, WIDX_BANK_RIGHT); + WindowEventMouseDownCall(w, WIDX_BANK_RIGHT); } else { @@ -4500,50 +4500,50 @@ void window_ride_construction_keyboard_shortcut_bank_right() } } -void window_ride_construction_keyboard_shortcut_previous_track() +void WindowRideConstructionKeyboardShortcutPreviousTrack() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_PREVIOUS_SECTION) || w->widgets[WIDX_PREVIOUS_SECTION].type == WindowWidgetType::Empty) { return; } - window_event_mouse_up_call(w, WIDX_PREVIOUS_SECTION); + WindowEventMouseUpCall(w, WIDX_PREVIOUS_SECTION); } -void window_ride_construction_keyboard_shortcut_next_track() +void WindowRideConstructionKeyboardShortcutNextTrack() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_NEXT_SECTION) || w->widgets[WIDX_NEXT_SECTION].type == WindowWidgetType::Empty) { return; } - window_event_mouse_up_call(w, WIDX_NEXT_SECTION); + WindowEventMouseUpCall(w, WIDX_NEXT_SECTION); } -void window_ride_construction_keyboard_shortcut_build_current() +void WindowRideConstructionKeyboardShortcutBuildCurrent() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) { return; } - window_event_mouse_up_call(w, WIDX_CONSTRUCT); + WindowEventMouseUpCall(w, WIDX_CONSTRUCT); } -void window_ride_construction_keyboard_shortcut_demolish_current() +void WindowRideConstructionKeyboardShortcutDemolishCurrent() { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_DEMOLISH) || w->widgets[WIDX_DEMOLISH].type == WindowWidgetType::Empty) { return; } - window_event_mouse_up_call(w, WIDX_DEMOLISH); + WindowEventMouseUpCall(w, WIDX_DEMOLISH); } static void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piecePos, int32_t type) diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 6b3dab6671..6e7fefcab3 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -217,7 +217,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_SORT: list_information_type = _windowRideListInformationType; @@ -360,7 +360,7 @@ public: void OnUpdate() override { frame_no = (frame_no + 1) % 64; - widget_invalidate(*this, WIDX_TAB_1 + page); + WidgetInvalidate(*this, WIDX_TAB_1 + page); if (_windowRideListInformationType != INFORMATION_TYPE_STATUS) Invalidate(); } @@ -957,7 +957,7 @@ private: rct_window* WindowRideListOpen() { // Check if window is already open - auto* window = window_bring_to_front_by_class(WindowClass::RideList); + auto* window = WindowBringToFrontByClass(WindowClass::RideList); if (window == nullptr) { window = WindowCreate(WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE); diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index c2b5725aaa..cfc7973655 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -106,7 +106,7 @@ public: OpenRCT2::Audio::StopAll(); } - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) @@ -130,7 +130,7 @@ public: OpenRCT2::Audio::Resume(); } - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); } void OnMouseUp(WidgetIndex widgetIndex) override @@ -218,10 +218,10 @@ rct_window* WindowSavePromptOpen() } // Check if window is already open - rct_window* window = window_bring_to_front_by_class(WindowClass::SavePrompt); + rct_window* window = WindowBringToFrontByClass(WindowClass::SavePrompt); if (window != nullptr) { - window_close(*window); + WindowClose(*window); } if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels)) diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index e576a10b9c..93239b85f7 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -158,10 +158,10 @@ rct_window* WindowScenarioselectOpen(scenarioselect_callback callback, bool titl if (_titleEditor != titleEditor) { _titleEditor = titleEditor; - window_close_by_class(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::ScenarioSelect); } - auto window = window_bring_to_front_by_class(WindowClass::ScenarioSelect); + auto window = WindowBringToFrontByClass(WindowClass::ScenarioSelect); if (window != nullptr) return window; @@ -264,7 +264,7 @@ static void WindowScenarioselectMouseup(rct_window* w, WidgetIndex widgetIndex) { if (widgetIndex == WIDX_CLOSE) { - window_close(*w); + WindowClose(*w); } } @@ -278,8 +278,8 @@ static void WindowScenarioselectMousedown(rct_window* w, WidgetIndex widgetIndex ConfigSaveDefault(); InitialiseListItems(w); w->Invalidate(); - window_event_resize_call(w); - window_event_invalidate_call(w); + WindowEventResizeCall(w); + WindowEventInvalidateCall(w); WindowInitScrollWidgets(*w); w->Invalidate(); } @@ -344,7 +344,7 @@ static void WindowScenarioselectScrollmousedown(rct_window* w, int32_t scrollInd _callback(listItem.scenario.scenario->path); if (_titleEditor) { - window_close(*w); + WindowClose(*w); } } break; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 20b22dc978..d6b0f32306 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -160,8 +160,8 @@ public: _activeTabIndex = 0; } - window_move_position(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D }); - window_push_others_below(*this); + WindowMovePosition(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D }); + WindowPushOthersBelow(*this); } void OnClose() override @@ -171,10 +171,10 @@ public: viewport_set_visibility(0); if (gWindowSceneryScatterEnabled) - window_close_by_class(WindowClass::SceneryScatter); + WindowCloseByClass(WindowClass::SceneryScatter); - if (scenery_tool_is_active()) - tool_cancel(); + if (SceneryToolIsActive()) + ToolCancel(); } void OnMouseUp(WidgetIndex widgetIndex) override @@ -194,14 +194,14 @@ public: gWindowSceneryPaintEnabled ^= 1; gWindowSceneryEyedropperEnabled = false; if (gWindowSceneryScatterEnabled) - window_close_by_class(WindowClass::SceneryScatter); + WindowCloseByClass(WindowClass::SceneryScatter); Invalidate(); break; case WIDX_SCENERY_EYEDROPPER_BUTTON: gWindowSceneryPaintEnabled = 0; gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; if (gWindowSceneryScatterEnabled) - window_close_by_class(WindowClass::SceneryScatter); + WindowCloseByClass(WindowClass::SceneryScatter); SceneryRemoveGhostToolPlacement(); Invalidate(); break; @@ -209,7 +209,7 @@ public: gWindowSceneryPaintEnabled = 0; gWindowSceneryEyedropperEnabled = false; if (gWindowSceneryScatterEnabled) - window_close_by_class(WindowClass::SceneryScatter); + WindowCloseByClass(WindowClass::SceneryScatter); else if ( network_get_mode() != NETWORK_MODE_CLIENT || network_can_perform_command(network_get_current_player_group_index(), -2)) @@ -247,7 +247,7 @@ public: height = min_height; Invalidate(); // HACK: For some reason invalidate has not been called - window_event_invalidate_call(this); + WindowEventInvalidateCall(this); ContentUpdateScroll(); } @@ -257,7 +257,7 @@ public: height = max_height; Invalidate(); // HACK: For some reason invalidate has not been called - window_event_invalidate_call(this); + WindowEventInvalidateCall(this); ContentUpdateScroll(); } } @@ -314,7 +314,7 @@ public: { // Find out what scenery the cursor is over const CursorState* state = ContextGetCursorState(); - WidgetIndex widgetIndex = window_find_widget_from_point(*this, state->position); + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); if (widgetIndex == WIDX_SCENERY_LIST) { ScreenCoordsXY scrollPos = {}; @@ -341,14 +341,14 @@ public: void OnUpdate() override { const CursorState* state = ContextGetCursorState(); - rct_window* other = window_find_from_point(state->position); + rct_window* other = WindowFindFromPoint(state->position); if (other == this) { ScreenCoordsXY window = state->position - ScreenCoordsXY{ windowPos.x - 26, windowPos.y }; if (window.y < 44 || window.x <= width) { - WidgetIndex widgetIndex = window_find_widget_from_point(*this, state->position); + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL) { _hoverCounter++; @@ -388,7 +388,7 @@ public: Invalidate(); - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { Close(); return; @@ -828,7 +828,7 @@ public: SortTabs(); PrepareWidgets(); - window_invalidate_by_class(WindowClass::Scenery); + WindowInvalidateByClass(WindowClass::Scenery); } int32_t GetRequiredWidth() const @@ -1349,7 +1349,7 @@ private: rct_window* WindowSceneryOpen() { - auto* w = static_cast(window_bring_to_front_by_class(WindowClass::Scenery)); + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); if (w == nullptr) { w = WindowCreate(WindowClass::Scenery); @@ -1361,7 +1361,7 @@ void WindowScenerySetSelectedItem( const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, const std::optional tertiary, const std::optional rotation) { - auto* w = static_cast(window_bring_to_front_by_class(WindowClass::Scenery)); + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); if (w != nullptr) { w->SetSelectedItem(scenery, primary, secondary, tertiary, rotation); @@ -1371,7 +1371,7 @@ void WindowScenerySetSelectedItem( void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) { // Should this bring to front? - auto* w = static_cast(window_find_by_class(WindowClass::Scenery)); + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); if (w != nullptr) { return w->SetSelectedTab(sceneryGroupIndex); @@ -1397,7 +1397,7 @@ void WindowScenerySetDefaultPlacementConfiguration() const ScenerySelection WindowSceneryGetTabSelection() { - auto* w = static_cast(window_find_by_class(WindowClass::Scenery)); + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); if (w != nullptr) { return w->GetTabSelection(); @@ -1410,7 +1410,7 @@ const ScenerySelection WindowSceneryGetTabSelection() void WindowSceneryInit() { - auto* w = static_cast(window_find_by_class(WindowClass::Scenery)); + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); if (w != nullptr) { w->Init(); diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 04dbaa250c..929a343214 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -60,7 +60,7 @@ public: widgets = window_scenery_scatter_widgets; hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); gWindowSceneryScatterEnabled = true; gWindowSceneryScatterSize = 16; @@ -93,7 +93,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_PREVIEW: @@ -195,7 +195,7 @@ public: rct_window* WindowSceneryScatterOpen() { // Check if window is already open - auto* window = window_find_by_class(WindowClass::SceneryScatter); + auto* window = WindowFindByClass(WindowClass::SceneryScatter); if (window == nullptr) { window = WindowCreate(WindowClass::SceneryScatter, 86, 100); diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 7360e6a710..d0876af7f3 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -121,7 +121,7 @@ rct_window* WindowServerListOpen() rct_window* window; // Check if window is already open - window = window_bring_to_front_by_class(WindowClass::ServerList); + window = WindowBringToFrontByClass(WindowClass::ServerList); if (window != nullptr) return window; @@ -142,7 +142,7 @@ rct_window* WindowServerListOpen() window->page = 0; window->list_information_type = 0; - window_set_resize(*window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); + WindowSetResize(*window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); safe_strcpy(_playerName, gConfigNetwork.PlayerName.c_str(), sizeof(_playerName)); @@ -164,10 +164,10 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close(*w); + WindowClose(*w); break; case WIDX_PLAYER_NAME_INPUT: - window_start_textbox(*w, widgetIndex, STR_STRING, _playerName, 63); + WindowStartTextbox(*w, widgetIndex, STR_STRING, _playerName, 63); break; case WIDX_LIST: { @@ -202,7 +202,7 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex) static void WindowServerListResize(rct_window* w) { - window_set_resize(*w, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); + WindowSetResize(*w, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); } static void WindowServerListDropdown(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex) @@ -239,8 +239,8 @@ static void WindowServerListUpdate(rct_window* w) { if (gCurrentTextBox.window.classification == w->classification && gCurrentTextBox.window.number == w->number) { - window_update_textbox_caret(); - widget_invalidate(*w, WIDX_PLAYER_NAME_INPUT); + WindowUpdateTextboxCaret(); + WidgetInvalidate(*w, WIDX_PLAYER_NAME_INPUT); } ServerListFetchServersCheck(w); } @@ -326,7 +326,7 @@ static void WindowServerListTextinput(rct_window* w, WidgetIndex widgetIndex, ch ConfigSaveDefault(); } - widget_invalidate(*w, WIDX_PLAYER_NAME_INPUT); + WidgetInvalidate(*w, WIDX_PLAYER_NAME_INPUT); break; case WIDX_ADD_SERVER: diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index adcacca040..300f99fa51 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -97,19 +97,19 @@ public: Close(); break; case WIDX_PORT_INPUT: - window_start_textbox(*this, widgetIndex, STR_STRING, _port, 6); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _port, 6); break; case WIDX_NAME_INPUT: - window_start_textbox(*this, widgetIndex, STR_STRING, _name, 64); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _name, 64); break; case WIDX_DESCRIPTION_INPUT: - window_start_textbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH); break; case WIDX_GREETING_INPUT: - window_start_textbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE); break; case WIDX_PASSWORD_INPUT: - window_start_textbox(*this, widgetIndex, STR_STRING, _password, 32); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _password, 32); break; case WIDX_MAXPLAYERS_INCREASE: if (gConfigNetwork.Maxplayers < 255) @@ -158,11 +158,11 @@ public: { if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) { - window_update_textbox_caret(); - widget_invalidate(*this, WIDX_NAME_INPUT); - widget_invalidate(*this, WIDX_DESCRIPTION_INPUT); - widget_invalidate(*this, WIDX_GREETING_INPUT); - widget_invalidate(*this, WIDX_PASSWORD_INPUT); + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_NAME_INPUT); + WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT); + WidgetInvalidate(*this, WIDX_GREETING_INPUT); + WidgetInvalidate(*this, WIDX_PASSWORD_INPUT); } } void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override @@ -187,7 +187,7 @@ public: gConfigNetwork.DefaultPort = atoi(_port); ConfigSaveDefault(); - widget_invalidate(*this, WIDX_NAME_INPUT); + WidgetInvalidate(*this, WIDX_NAME_INPUT); break; case WIDX_NAME_INPUT: if (strcmp(_name, temp.c_str()) == 0) @@ -205,7 +205,7 @@ public: ConfigSaveDefault(); } - widget_invalidate(*this, WIDX_NAME_INPUT); + WidgetInvalidate(*this, WIDX_NAME_INPUT); break; case WIDX_DESCRIPTION_INPUT: if (strcmp(_description, temp.c_str()) == 0) @@ -223,7 +223,7 @@ public: ConfigSaveDefault(); } - widget_invalidate(*this, WIDX_DESCRIPTION_INPUT); + WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT); break; case WIDX_GREETING_INPUT: if (strcmp(_greeting, temp.c_str()) == 0) @@ -241,7 +241,7 @@ public: ConfigSaveDefault(); } - widget_invalidate(*this, WIDX_GREETING_INPUT); + WidgetInvalidate(*this, WIDX_GREETING_INPUT); break; case WIDX_PASSWORD_INPUT: if (strcmp(_password, temp.c_str()) == 0) @@ -253,7 +253,7 @@ public: safe_strcpy(_password, temp.c_str(), sizeof(_password)); } - widget_invalidate(*this, WIDX_PASSWORD_INPUT); + WidgetInvalidate(*this, WIDX_PASSWORD_INPUT); break; } } diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index b6332696d4..1469d92700 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -78,7 +78,7 @@ public: auto registeredShortcut = shortcutManager.GetShortcut(shortcutId); if (registeredShortcut != nullptr) { - window_close_by_class(WindowClass::ChangeKeyboardShortcut); + WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); auto w = WindowCreate( WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); if (w != nullptr) @@ -195,7 +195,7 @@ public: void OnResize() override { - window_set_resize(*this, min_width, min_height, max_width, max_height); + WindowSetResize(*this, min_width, min_height, max_width, max_height); } void OnUpdate() override @@ -239,7 +239,7 @@ public: widgets[WIDX_SCROLL].bottom = height - 19; widgets[WIDX_RESET].top = height - 16; widgets[WIDX_RESET].bottom = height - 5; - window_align_tabs(this, WIDX_TAB_0, static_cast(WIDX_TAB_0 + _tabs.size())); + WindowAlignTabs(this, WIDX_TAB_0, static_cast(WIDX_TAB_0 + _tabs.size())); // Set selected tab for (size_t i = 0; i < _tabs.size(); i++) @@ -540,7 +540,7 @@ private: void ChangeShortcutWindow::NotifyShortcutKeysWindow() { - auto w = window_find_by_class(WindowClass::KeyboardShortcutList); + auto w = WindowFindByClass(WindowClass::KeyboardShortcutList); if (w != nullptr) { static_cast(w)->RefreshBindings(); @@ -549,7 +549,7 @@ void ChangeShortcutWindow::NotifyShortcutKeysWindow() rct_window* WindowShortcutKeysOpen() { - auto w = window_bring_to_front_by_class(WindowClass::KeyboardShortcutList); + auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList); if (w == nullptr) { w = WindowCreate(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 1a8c286116..994a14b91d 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -285,7 +285,7 @@ public: if (viewport != nullptr) { - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); } } @@ -318,7 +318,7 @@ public: */ rct_window* WindowSignOpen(rct_windownumber number) { - auto* w = static_cast(window_bring_to_front_by_number(WindowClass::Banner, number)); + auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; @@ -341,7 +341,7 @@ rct_window* WindowSignOpen(rct_windownumber number) */ rct_window* WindowSignSmallOpen(rct_windownumber number) { - auto* w = static_cast(window_bring_to_front_by_number(WindowClass::Banner, number)); + auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index e3501e8e90..5475215bc3 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -344,7 +344,7 @@ private: void CommonPrepareDrawAfter() { - window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_3); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_3); } #pragma endregion @@ -369,10 +369,10 @@ private: pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - rct_window* wind = window_find_by_number(WindowClass::Peep, peepnum); + rct_window* wind = WindowFindByNumber(WindowClass::Peep, peepnum); if (wind != nullptr) { - tool_set(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); + ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); } }); GameActions::Execute(&pickupAction); @@ -458,7 +458,7 @@ private: return; } - window_close_by_class(WindowClass::PatrolArea); + WindowCloseByClass(WindowClass::PatrolArea); auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( staff->sprite_index, {}, StaffSetPatrolAreaMode::ClearAll); @@ -469,7 +469,7 @@ private: auto staffId = EntityId::FromUnderlying(number); if (WindowPatrolAreaGetCurrentStaffId() == staffId) { - window_close_by_class(WindowClass::PatrolArea); + WindowCloseByClass(WindowClass::PatrolArea); } else { @@ -519,7 +519,7 @@ private: // Draw the viewport no sound sprite if (viewport != nullptr) { - window_draw_viewport(dpi, *this); + WindowDrawViewport(dpi, *this); if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) { @@ -697,7 +697,7 @@ private: pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - tool_cancel(); + ToolCancel(); gPickupPeepImage = ImageId(); }); GameActions::Execute(&pickupAction); @@ -1065,7 +1065,7 @@ private: if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) - tool_cancel(); + ToolCancel(); } } @@ -1089,8 +1089,8 @@ private: RemoveViewport(); Invalidate(); - window_event_resize_call(this); - window_event_invalidate_call(this); + WindowEventResizeCall(this); + WindowEventInvalidateCall(this); InitScrollWidgets(); ViewportInit(); Invalidate(); @@ -1153,7 +1153,7 @@ private: viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } - window_event_invalidate_call(this); + WindowEventInvalidateCall(this); focus = tempFocus; @@ -1190,8 +1190,8 @@ private: void FollowPeep() { - rct_window* main = window_get_main(); - window_follow_sprite(*main, EntityId::FromUnderlying(number)); + rct_window* main = WindowGetMain(); + WindowFollowSprite(*main, EntityId::FromUnderlying(number)); } void DrawTabImages(rct_drawpixelinfo* dpi) @@ -1236,7 +1236,7 @@ private: rct_window* WindowStaffOpen(Peep* peep) { - auto w = static_cast(window_bring_to_front_by_number(WindowClass::Peep, peep->sprite_index.ToUnderlying())); + auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->sprite_index.ToUnderlying())); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 2a7957c0f5..97d23ddfee 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -139,7 +139,7 @@ public: break; } case WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON: - if (!tool_set(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair)) + if (!ToolSet(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair)) { show_gridlines(); SetPatrolAreaToRender(GetSelectedStaffType()); @@ -184,7 +184,7 @@ public: InvalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab); // Enable highlighting of these staff members in map window - if (window_find_by_class(WindowClass::Map) != nullptr) + if (WindowFindByClass(WindowClass::Map) != nullptr) { gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen; for (auto peep : EntityList()) @@ -453,9 +453,9 @@ public: auto closestStaffMember = GetClosestStaffMemberTo(screenCoords); if (closestStaffMember != nullptr) { - tool_cancel(); + ToolCancel(); auto* staffWindow = WindowStaffOpen(closestStaffMember); - window_event_dropdown_call(staffWindow, WC_PEEP__WIDX_PATROL, 0); + WindowEventDropdownCall(staffWindow, WC_PEEP__WIDX_PATROL, 0); } else { @@ -471,7 +471,7 @@ public: if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON) { hide_gridlines(); - tool_cancel(); + ToolCancel(); ClearPatrolAreaToRender(); GfxInvalidateScreen(); } @@ -581,7 +581,7 @@ private: { if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) { - tool_cancel(); + ToolCancel(); } } } @@ -710,7 +710,7 @@ rct_window* WindowStaffListOpen() void WindowStaffListRefresh() { - auto* window = window_find_by_class(WindowClass::StaffList); + auto* window = WindowFindByClass(WindowClass::StaffList); if (window != nullptr) { static_cast(window)->RefreshList(); diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 2607dff4ec..c0555a17bf 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -135,7 +135,7 @@ public: auto parentWindow = GetParentWindow(); if (parentWindow == nullptr) { - window_close(*this); + WindowClose(*this); return; } } @@ -156,12 +156,12 @@ public: case WIDX_CLOSE: ContextStopTextInput(); ExecuteCallback(false); - window_close(*this); + WindowClose(*this); break; case WIDX_OKAY: ContextStopTextInput(); ExecuteCallback(true); - window_close(*this); + WindowClose(*this); } } @@ -171,7 +171,7 @@ public: int32_t newHeight = CalculateWindowHeight(_buffer.data()); if (newHeight != height) { - window_set_resize(*this, WW, newHeight, WW, newHeight); + WindowSetResize(*this, WW, newHeight, WW, newHeight); } widgets[WIDX_OKAY].top = newHeight - 22; @@ -300,7 +300,7 @@ public: { ContextStopTextInput(); ExecuteCallback(true); - window_close(*this); + WindowClose(*this); } static int32_t CalculateWindowHeight(std::string_view text) @@ -337,7 +337,7 @@ private: if (w != nullptr) { auto value = hasValue ? _buffer.data() : nullptr; - window_event_textinput_call(w, _parentWidget.widget_index, value); + WindowEventTextinputCall(w, _parentWidget.widget_index, value); } } else @@ -366,7 +366,7 @@ private: rct_window* GetParentWindow() const { - return HasParentWindow() ? window_find_by_number(_parentWidget.window.classification, _parentWidget.window.number) + return HasParentWindow() ? WindowFindByNumber(_parentWidget.window.classification, _parentWidget.window.number) : nullptr; } }; @@ -375,7 +375,7 @@ void WindowTextInputRawOpen( rct_window* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength) { - window_close_by_class(WindowClass::Textinput); + WindowCloseByClass(WindowClass::Textinput); auto height = TextInputWindow::CalculateWindowHeight(existing_text); auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); @@ -425,7 +425,7 @@ void WindowTextInputKey(rct_window* w, uint32_t keycode) } // The window can be potentially closed within a callback, we need to check if its still alive. - w = window_find_by_number(wndClass, wndNumber); + w = WindowFindByNumber(wndClass, wndNumber); if (w != nullptr) w->Invalidate(); } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index bcc8f99e64..5e42130691 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -358,7 +358,7 @@ public: if (frame_no >= window_themes_tab_animation_loops[_selected_tab]) frame_no = 0; - widget_invalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab); + WidgetInvalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab); } void OnPrepareDraw() override @@ -371,7 +371,7 @@ public: pressed_widgets = pressedWidgets | (1 << widgetIndex); - if (window_find_by_class(WindowClass::Dropdown) == nullptr) + if (WindowFindByClass(WindowClass::Dropdown) == nullptr) { _colour_index_1 = -1; _colour_index_2 = -1; @@ -494,7 +494,7 @@ public: _selected_tab = static_cast(newSelectedTab); scrolls[0].v_top = 0; frame_no = 0; - window_event_resize_call(this); + WindowEventResizeCall(this); Invalidate(); break; case WIDX_THEMES_PRESETS_DROPDOWN: @@ -523,7 +523,7 @@ public: { ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE); ThemeSave(); - window_invalidate_all(); + WindowInvalidateAll(); } break; case WIDX_THEMES_RCT1_PARK_LIGHTS: @@ -535,7 +535,7 @@ public: { ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_LIGHTS_PARK)); ThemeSave(); - window_invalidate_all(); + WindowInvalidateAll(); } break; case WIDX_THEMES_RCT1_SCENARIO_FONT: @@ -547,7 +547,7 @@ public: { ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)); ThemeSave(); - window_invalidate_all(); + WindowInvalidateAll(); } break; case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: @@ -559,7 +559,7 @@ public: { ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)); ThemeSave(); - window_invalidate_all(); + WindowInvalidateAll(); } } } @@ -620,7 +620,7 @@ public: colour = (colour & COLOUR_FLAG_TRANSLUCENT) | selectedIndex; ThemeSetColour(wc, _colour_index_2, colour); ColourSchemeUpdateAll(); - window_invalidate_all(); + WindowInvalidateAll(); _colour_index_1 = -1; _colour_index_2 = -1; } @@ -727,7 +727,7 @@ public: uint8_t colour = ThemeGetColour(wc, _colour_index_2); WindowDropdownShowColour( this, &(window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]), colours[1], colour); - widget_invalidate(*this, WIDX_THEMES_LIST); + WidgetInvalidate(*this, WIDX_THEMES_LIST); } } else if ( @@ -751,7 +751,7 @@ public: } ThemeSetColour(wc, _colour_index_2, colour); ColourSchemeUpdateAll(); - window_invalidate_all(); + WindowInvalidateAll(); } } } @@ -887,7 +887,7 @@ rct_window* WindowThemesOpen() rct_window* window; // Check if window is already open - window = window_bring_to_front_by_class(WindowClass::Themes); + window = WindowBringToFrontByClass(WindowClass::Themes); if (window != nullptr) return window; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index cd63500091..4027019989 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -492,7 +492,7 @@ public: WindowInitScrollWidgets(*this); _tileSelected = false; - tool_set(*this, WIDX_BACKGROUND, Tool::Crosshair); + ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); } void OnUpdate() override @@ -512,7 +512,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - tool_cancel(); + ToolCancel(); Close(); return; @@ -2340,7 +2340,7 @@ private: rct_window* WindowTileInspectorOpen() { - rct_window* window = window_bring_to_front_by_class(WindowClass::TileInspector); + rct_window* window = WindowBringToFrontByClass(WindowClass::TileInspector); if (window == nullptr) window = WindowCreate(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); return window; @@ -2348,7 +2348,7 @@ rct_window* WindowTileInspectorOpen() void WindowTileInspectorClearClipboard() { - auto* window = window_find_by_class(WindowClass::TileInspector); + auto* window = WindowFindByClass(WindowClass::TileInspector); if (window != nullptr) static_cast(window)->ClearClipboard(); } diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 4823bd9632..baf972d40b 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -67,7 +67,7 @@ public: rct_window* WindowTitleLogoOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::TitleLogo); + auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo); if (window == nullptr) { window = WindowCreate( diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index a088b8fc27..3d33c285c7 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -125,42 +125,42 @@ public: switch (widgetIndex) { case WIDX_START_NEW_GAME: - windowToOpen = window_find_by_class(WindowClass::ScenarioSelect); + windowToOpen = WindowFindByClass(WindowClass::ScenarioSelect); if (windowToOpen != nullptr) { - window_bring_to_front(*windowToOpen); + WindowBringToFront(*windowToOpen); } else { - window_close_by_class(WindowClass::Loadsave); - window_close_by_class(WindowClass::ServerList); + WindowCloseByClass(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::ServerList); WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback, false); } break; case WIDX_CONTINUE_SAVED_GAME: - windowToOpen = window_find_by_class(WindowClass::Loadsave); + windowToOpen = WindowFindByClass(WindowClass::Loadsave); if (windowToOpen != nullptr) { - window_bring_to_front(*windowToOpen); + WindowBringToFront(*windowToOpen); } else { - window_close_by_class(WindowClass::ScenarioSelect); - window_close_by_class(WindowClass::ServerList); + WindowCloseByClass(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::ServerList); auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); GameActions::Execute(&loadOrQuitAction); } break; case WIDX_MULTIPLAYER: - windowToOpen = window_find_by_class(WindowClass::ServerList); + windowToOpen = WindowFindByClass(WindowClass::ServerList); if (windowToOpen != nullptr) { - window_bring_to_front(*windowToOpen); + WindowBringToFront(*windowToOpen); } else { - window_close_by_class(WindowClass::ScenarioSelect); - window_close_by_class(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::Loadsave); ContextOpenWindow(WindowClass::ServerList); } break; diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index f936c19592..9786ab5393 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -55,7 +55,7 @@ public: */ rct_window* WindowTitleOptionsOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::TitleOptions); + auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions); if (window == nullptr) { window = WindowCreate( diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 2b56972015..5f571dfa36 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -134,7 +134,7 @@ void WindowTooltipReset(const ScreenCoordsXY& screenCoords) void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) { - auto* w = window_find_by_class(WindowClass::Error); + auto* w = WindowFindByClass(WindowClass::Error); if (w != nullptr) return; @@ -151,7 +151,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const return; auto widget = &widgetWindow->widgets[widgetIndex]; - window_event_invalidate_call(widgetWindow); + WindowEventInvalidateCall(widgetWindow); OpenRCT2String result; if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING) @@ -177,7 +177,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const gTooltipWidget.window_classification = widgetWindow->classification; gTooltipWidget.window_number = widgetWindow->number; gTooltipWidget.widget_index = widgetIndex; - result = window_event_tooltip_call(widgetWindow, widgetIndex, stringId); + result = WindowEventTooltipCall(widgetWindow, widgetIndex, stringId); if (result.str == STR_NONE) return; } @@ -187,7 +187,7 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const void WindowTooltipClose() { - window_close_by_class(WindowClass::Tooltip); + WindowCloseByClass(WindowClass::Tooltip); gTooltipTimeout = 0; gTooltipWidget.window_classification = WindowClass::Null; } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 95db45973e..80b0c3d7b2 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -365,12 +365,12 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex) } break; case WIDX_ZOOM_OUT: - if ((mainWindow = window_get_main()) != nullptr) - window_zoom_out(*mainWindow, false); + if ((mainWindow = WindowGetMain()) != nullptr) + WindowZoomOut(*mainWindow, false); break; case WIDX_ZOOM_IN: - if ((mainWindow = window_get_main()) != nullptr) - window_zoom_in(*mainWindow, false); + if ((mainWindow = WindowGetMain()) != nullptr) + WindowZoomIn(*mainWindow, false); break; case WIDX_CLEAR_SCENERY: ToggleClearSceneryWindow(w, WIDX_CLEAR_SCENERY); @@ -382,7 +382,7 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex) ToggleWaterWindow(w, WIDX_WATER); break; case WIDX_SCENERY: - if (!tool_set(*w, WIDX_SCENERY, Tool::Arrow)) + if (!ToolSet(*w, WIDX_SCENERY, Tool::Arrow)) { input_set_flag(INPUT_FLAG_6, true); ContextOpenWindow(WindowClass::Scenery); @@ -575,7 +575,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int break; } case DDIDX_SAVE_GAME: - tool_cancel(); + ToolCancel(); save_game(); break; case DDIDX_SAVE_GAME_AS: @@ -588,7 +588,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int } else { - tool_cancel(); + ToolCancel(); save_game_as(); } break; @@ -618,8 +618,8 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int break; case DDIDX_QUIT_TO_MENU: { - window_close_by_class(WindowClass::ManageTrackDesign); - window_close_by_class(WindowClass::TrackDeletePrompt); + WindowCloseByClass(WindowClass::ManageTrackDesign); + WindowCloseByClass(WindowClass::TrackDeletePrompt); auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PromptMode::SaveBeforeQuit); GameActions::Execute(&loadOrQuitAction); break; @@ -815,7 +815,7 @@ static void WindowTopToolbarInvalidate(rct_window* w) } // Footpath button pressed down - if (window_find_by_class(WindowClass::Footpath) == nullptr) + if (WindowFindByClass(WindowClass::Footpath) == nullptr) w->pressed_widgets &= ~(1uLL << WIDX_PATH); else w->pressed_widgets |= (1uLL << WIDX_PATH); @@ -845,7 +845,7 @@ static void WindowTopToolbarInvalidate(rct_window* w) } // Zoomed out/in disable. Not sure where this code is in the original. - const auto* mainWindow = window_get_main(); + const auto* mainWindow = WindowGetMain(); if (mainWindow == nullptr || mainWindow->viewport == nullptr) { log_error("mainWindow or mainWindow->viewport is null!"); @@ -1211,7 +1211,7 @@ static void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, Scre // SHIFT pressed gSceneryShiftPressZOffset = (gSceneryShiftPressY - screenPos.y + 4); // Scale delta by zoom to match mouse position. - auto* mainWnd = window_get_main(); + auto* mainWnd = WindowGetMain(); if (mainWnd != nullptr && mainWnd->viewport != nullptr) { gSceneryShiftPressZOffset = mainWnd->viewport->zoom.ApplyTo(gSceneryShiftPressZOffset); @@ -1234,7 +1234,7 @@ static void Sub6E1F34SmallScenery( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outQuadrant, Direction* outRotation) { - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w == nullptr) { @@ -1430,7 +1430,7 @@ static void Sub6E1F34SmallScenery( static void Sub6E1F34PathItem( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ) { - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w == nullptr) { @@ -1463,7 +1463,7 @@ static void Sub6E1F34PathItem( static void Sub6E1F34Wall( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outEdges) { - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w == nullptr) { @@ -1552,7 +1552,7 @@ static void Sub6E1F34Wall( static void Sub6E1F34LargeScenery( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, Direction* outDirection) { - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w == nullptr) { @@ -1652,7 +1652,7 @@ static void Sub6E1F34Banner( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ, Direction* outDirection) { - rct_window* w = window_find_by_class(WindowClass::Scenery); + rct_window* w = WindowFindByClass(WindowClass::Scenery); if (w == nullptr) { @@ -2012,7 +2012,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos) if (gClearSceneryCost != MONEY64_UNDEFINED) { gClearSceneryCost = MONEY64_UNDEFINED; - window_invalidate_by_class(WindowClass::ClearScenery); + WindowInvalidateByClass(WindowClass::ClearScenery); } return state_changed; } @@ -2083,7 +2083,7 @@ static void TopToolbarToolUpdateSceneryClear(const ScreenCoordsXY& screenPos) if (gClearSceneryCost != cost) { gClearSceneryCost = cost; - window_invalidate_by_class(WindowClass::ClearScenery); + WindowInvalidateByClass(WindowClass::ClearScenery); } } @@ -2109,7 +2109,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { gLandToolRaiseCost = raise_cost; gLandToolLowerCost = lower_cost; - window_invalidate_by_class(WindowClass::Land); + WindowInvalidateByClass(WindowClass::Land); } return; } @@ -2135,7 +2135,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { gLandToolRaiseCost = raise_cost; gLandToolLowerCost = lower_cost; - window_invalidate_by_class(WindowClass::Land); + WindowInvalidateByClass(WindowClass::Land); } return; } @@ -2195,7 +2195,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { gLandToolRaiseCost = raise_cost; gLandToolLowerCost = lower_cost; - window_invalidate_by_class(WindowClass::Land); + WindowInvalidateByClass(WindowClass::Land); } return; } @@ -2212,7 +2212,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { gLandToolRaiseCost = raise_cost; gLandToolLowerCost = lower_cost; - window_invalidate_by_class(WindowClass::Land); + WindowInvalidateByClass(WindowClass::Land); } return; } @@ -2321,7 +2321,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { gLandToolRaiseCost = raise_cost; gLandToolLowerCost = lower_cost; - window_invalidate_by_class(WindowClass::Land); + WindowInvalidateByClass(WindowClass::Land); } } @@ -2353,7 +2353,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos) { gWaterToolRaiseCost = raiseCost; gWaterToolLowerCost = lowerCost; - window_invalidate_by_class(WindowClass::Water); + WindowInvalidateByClass(WindowClass::Water); } return; } @@ -2369,7 +2369,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos) { gWaterToolRaiseCost = MONEY64_UNDEFINED; gWaterToolLowerCost = MONEY64_UNDEFINED; - window_invalidate_by_class(WindowClass::Water); + WindowInvalidateByClass(WindowClass::Water); } return; } @@ -2445,7 +2445,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos) { gWaterToolRaiseCost = raiseCost; gWaterToolLowerCost = lowerCost; - window_invalidate_by_class(WindowClass::Water); + WindowInvalidateByClass(WindowClass::Water); } } @@ -3060,10 +3060,10 @@ static money64 SelectionLowerLand(uint8_t flags) */ static void WindowTopToolbarLandToolDrag(const ScreenCoordsXY& screenPos) { - rct_window* window = window_find_from_point(screenPos); + rct_window* window = WindowFindFromPoint(screenPos); if (window == nullptr) return; - WidgetIndex widget_index = window_find_widget_from_point(*window, screenPos); + WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos); if (widget_index == -1) return; const auto& widget = window->widgets[widget_index]; @@ -3103,10 +3103,10 @@ static void WindowTopToolbarLandToolDrag(const ScreenCoordsXY& screenPos) */ static void WindowTopToolbarWaterToolDrag(const ScreenCoordsXY& screenPos) { - rct_window* window = window_find_from_point(screenPos); + rct_window* window = WindowFindFromPoint(screenPos); if (!window) return; - WidgetIndex widget_index = window_find_widget_from_point(*window, screenPos); + WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos); if (widget_index == -1) return; const auto& widget = window->widgets[widget_index]; @@ -3159,7 +3159,7 @@ static void WindowTopToolbarToolDrag(rct_window* w, WidgetIndex widgetIndex, con switch (widgetIndex) { case WIDX_CLEAR_SCENERY: - if (window_find_by_class(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + if (WindowFindByClass(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) { auto action = GetClearAction(); GameActions::Execute(&action); @@ -3405,7 +3405,7 @@ static void TopToolbarInitFastforwardMenu(rct_window* w, Widget* widget) static void TopToolbarFastforwardMenuDropdown(int16_t dropdownIndex) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w) { if (dropdownIndex >= 0 && dropdownIndex <= 5) @@ -3431,17 +3431,17 @@ static void TopToolbarInitRotateMenu(rct_window* w, Widget* widget) static void TopToolbarRotateMenuDropdown(int16_t dropdownIndex) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w) { if (dropdownIndex == 0) { - window_rotate_camera(*w, 1); + WindowRotateCamera(*w, 1); w->Invalidate(); } else if (dropdownIndex == 1) { - window_rotate_camera(*w, -1); + WindowRotateCamera(*w, -1); w->Invalidate(); } } @@ -3515,7 +3515,7 @@ static void TopToolbarCheatsMenuDropdown(int16_t dropdownIndex) ContextOpenWindow(WindowClass::TileInspector); break; case DDIDX_OBJECT_SELECTION: - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorObjectSelection); break; case DDIDX_INVENTIONS_LIST: @@ -3550,7 +3550,7 @@ static void TopToolbarInitDebugMenu(rct_window* w, Widget* widget) { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[0] | 0x80, Dropdown::Flag::StayOpen, TOP_TOOLBAR_DEBUG_COUNT); - Dropdown::SetChecked(DDIDX_DEBUG_PAINT, window_find_by_class(WindowClass::DebugPaint) != nullptr); + Dropdown::SetChecked(DDIDX_DEBUG_PAINT, WindowFindByClass(WindowClass::DebugPaint) != nullptr); } static void TopToolbarInitNetworkMenu(rct_window* w, Widget* widget) @@ -3569,7 +3569,7 @@ static void TopToolbarInitNetworkMenu(rct_window* w, Widget* widget) static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { switch (dropdownIndex) @@ -3581,13 +3581,13 @@ static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex) break; } case DDIDX_DEBUG_PAINT: - if (window_find_by_class(WindowClass::DebugPaint) == nullptr) + if (WindowFindByClass(WindowClass::DebugPaint) == nullptr) { ContextOpenWindow(WindowClass::DebugPaint); } else { - window_close_by_class(WindowClass::DebugPaint); + WindowCloseByClass(WindowClass::DebugPaint); } break; } @@ -3596,7 +3596,7 @@ static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex) static void TopToolbarNetworkMenuDropdown(int16_t dropdownIndex) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { switch (dropdownIndex) @@ -3652,7 +3652,7 @@ static void TopToolbarInitViewMenu(rct_window* w, Widget* widget) TOP_TOOLBAR_VIEW_MENU_COUNT); // Set checkmarks - rct_viewport* mainViewport = window_get_main()->viewport; + rct_viewport* mainViewport = WindowGetMain()->viewport; if (mainViewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) Dropdown::SetChecked(DDIDX_UNDERGROUND_INSIDE, true); if (gConfigGeneral.TransparentWater) @@ -3703,7 +3703,7 @@ static void TopToolbarInitViewMenu(rct_window* w, Widget* widget) */ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { switch (dropdownIndex) @@ -3755,7 +3755,7 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) w->viewport->flags ^= VIEWPORT_FLAG_PATH_HEIGHTS; break; case DDIDX_VIEW_CLIPPING: - if (window_find_by_class(WindowClass::ViewClipping) == nullptr) + if (WindowFindByClass(WindowClass::ViewClipping) == nullptr) { ContextOpenWindow(WindowClass::ViewClipping); } @@ -3784,14 +3784,14 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) */ static void ToggleFootpathWindow() { - if (window_find_by_class(WindowClass::Footpath) == nullptr) + if (WindowFindByClass(WindowClass::Footpath) == nullptr) { ContextOpenWindow(WindowClass::Footpath); } else { - tool_cancel(); - window_close_by_class(WindowClass::Footpath); + ToolCancel(); + WindowCloseByClass(WindowClass::Footpath); } } @@ -3804,13 +3804,13 @@ static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex) if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar && gCurrentToolWidget.widget_index == WIDX_LAND) { - tool_cancel(); + ToolCancel(); } else { _landToolBlocked = false; show_gridlines(); - tool_set(*topToolbar, widgetIndex, Tool::DigDown); + ToolSet(*topToolbar, widgetIndex, Tool::DigDown); input_set_flag(INPUT_FLAG_6, true); ContextOpenWindow(WindowClass::Land); } @@ -3825,12 +3825,12 @@ static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetI if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar && gCurrentToolWidget.widget_index == WIDX_CLEAR_SCENERY)) { - tool_cancel(); + ToolCancel(); } else { show_gridlines(); - tool_set(*topToolbar, widgetIndex, Tool::Crosshair); + ToolSet(*topToolbar, widgetIndex, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); ContextOpenWindow(WindowClass::ClearScenery); } @@ -3845,13 +3845,13 @@ static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex) if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar && gCurrentToolWidget.widget_index == WIDX_WATER) { - tool_cancel(); + ToolCancel(); } else { _landToolBlocked = false; show_gridlines(); - tool_set(*topToolbar, widgetIndex, Tool::WaterDown); + ToolSet(*topToolbar, widgetIndex, Tool::WaterDown); input_set_flag(INPUT_FLAG_6, true); ContextOpenWindow(WindowClass::Water); } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 180442356a..81a3126ee9 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -91,7 +91,7 @@ static void WindowTrackDesignListReloadTracks(); */ rct_window* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef) { - window_close_by_class(WindowClass::ManageTrackDesign); + WindowCloseByClass(WindowClass::ManageTrackDesign); auto trackDesignManageWindow = std::make_unique(tdFileRef); auto* window = WindowCreate( std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, @@ -105,7 +105,7 @@ void TrackDesignManageWindow::OnOpen() widgets = window_track_manage_widgets; WindowInitScrollWidgets(*this); - auto* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList); + auto* trackDesignListWindow = WindowFindByClass(WindowClass::TrackDesignList); if (trackDesignListWindow != nullptr) { trackDesignListWindow->track_list.track_list_being_updated = true; @@ -114,7 +114,7 @@ void TrackDesignManageWindow::OnOpen() void TrackDesignManageWindow::OnClose() { - rct_window* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList); + rct_window* trackDesignListWindow = WindowFindByClass(WindowClass::TrackDesignList); if (trackDesignListWindow != nullptr) { trackDesignListWindow->track_list.track_list_being_updated = false; @@ -126,7 +126,7 @@ void TrackDesignManageWindow::OnMouseUp(WidgetIndex widgetIndex) switch (widgetIndex) { case WIDX_CLOSE: - window_close_by_class(WindowClass::TrackDeletePrompt); + WindowCloseByClass(WindowClass::TrackDeletePrompt); Close(); break; case WIDX_RENAME: @@ -159,7 +159,7 @@ void TrackDesignManageWindow::OnTextInput(WidgetIndex widgetIndex, std::string_v if (track_repository_rename(_trackDesignFileReference->path, std::string(text))) { - window_close_by_class(WindowClass::TrackDeletePrompt); + WindowCloseByClass(WindowClass::TrackDeletePrompt); Close(); WindowTrackDesignListReloadTracks(); } @@ -181,7 +181,7 @@ void TrackDesignManageWindow::OnDraw(rct_drawpixelinfo& dpi) */ static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef) { - window_close_by_class(WindowClass::TrackDeletePrompt); + WindowCloseByClass(WindowClass::TrackDeletePrompt); int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); @@ -212,7 +212,7 @@ void TrackDeletePromptWindow::OnMouseUp(WidgetIndex widgetIndex) Close(); if (track_repository_delete(tdPath)) { - window_close_by_class(WindowClass::ManageTrackDesign); + WindowCloseByClass(WindowClass::ManageTrackDesign); WindowTrackDesignListReloadTracks(); } else @@ -236,7 +236,7 @@ void TrackDeletePromptWindow::OnDraw(rct_drawpixelinfo& dpi) static void WindowTrackDesignListReloadTracks() { - rct_window* trackListWindow = window_find_by_class(WindowClass::TrackDesignList); + rct_window* trackListWindow = WindowFindByClass(WindowClass::TrackDesignList); if (trackListWindow != nullptr) { trackListWindow->track_list.reload_track_designs = true; diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 977fa26d2c..87f5848f36 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -79,9 +79,9 @@ public: { widgets = window_track_place_widgets; WindowInitScrollWidgets(*this); - tool_set(*this, WIDX_PRICE, Tool::Crosshair); + ToolSet(*this, WIDX_PRICE, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); - window_push_others_right(*this); + WindowPushOthersRight(*this); show_gridlines(); _miniPreview.resize(TRACK_MINI_PREVIEW_SIZE); _placementCost = MONEY32_UNDEFINED; @@ -200,7 +200,7 @@ public: if (cost != _placementCost) { _placementCost = cost; - widget_invalidate(*this, WIDX_PRICE); + WidgetInvalidate(*this, WIDX_PRICE); } TrackDesignPreviewDrawOutlines(tds, _trackDesign.get(), *GetOrAllocateRide(PreviewRideId), trackLoc); @@ -233,7 +233,7 @@ public: auto getRide = get_ride(rideId); if (getRide != nullptr) { - window_close_by_class(WindowClass::Error); + WindowCloseByClass(WindowClass::Error); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc); _currentRideIndex = rideId; @@ -242,14 +242,14 @@ public: auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying()); ContextOpenIntent(&intent); - auto wnd = window_find_by_class(WindowClass::TrackDesignPlace); - window_close(*wnd); + auto wnd = WindowFindByClass(WindowClass::TrackDesignPlace); + WindowClose(*wnd); } else { ride_initialise_construction_window(*getRide); - auto wnd = window_find_by_class(WindowClass::RideConstruction); - window_event_mouse_up_call(wnd, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + auto wnd = WindowFindByClass(WindowClass::RideConstruction); + WindowEventMouseUpCall(wnd, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); } } } @@ -621,7 +621,7 @@ rct_window* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef) return nullptr; } - window_close_construction_windows(); + WindowCloseConstructionWindows(); auto* window = WindowFocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); if (window != nullptr) @@ -633,7 +633,7 @@ rct_window* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef) void TrackPlaceClearProvisionalTemporarily() { - auto* trackPlaceWnd = static_cast(window_find_by_class(WindowClass::TrackDesignPlace)); + auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); if (trackPlaceWnd != nullptr) { trackPlaceWnd->ClearProvisionalTemporarily(); @@ -642,7 +642,7 @@ void TrackPlaceClearProvisionalTemporarily() void TrackPlaceRestoreProvisional() { - auto* trackPlaceWnd = static_cast(window_find_by_class(WindowClass::TrackDesignPlace)); + auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); if (trackPlaceWnd != nullptr) { trackPlaceWnd->RestoreProvisional(); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 246cd9a9fa..87d899dd19 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -224,7 +224,7 @@ public: selected_list_item = 1; } gTrackDesignSceneryToggle = false; - window_push_others_right(*this); + WindowPushOthersRight(*this); _currentTrackPieceDirection = 2; _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); @@ -249,8 +249,8 @@ public: // try to load the track manager again, and an infinite loop will result. if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && gScreenAge != 0) { - window_close_by_number(WindowClass::ManageTrackDesign, number); - window_close_by_number(WindowClass::TrackDeletePrompt, number); + WindowCloseByNumber(WindowClass::ManageTrackDesign, number); + WindowCloseByNumber(WindowClass::TrackDeletePrompt, number); Editor::LoadTrackManager(); } } @@ -280,8 +280,7 @@ public: } break; case WIDX_FILTER_STRING: - window_start_textbox( - *this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out break; case WIDX_FILTER_CLEAR: // Keep the highlighted item selected @@ -421,8 +420,8 @@ public: { if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) { - window_update_textbox_caret(); - widget_invalidate(*this, WIDX_FILTER_STRING); // TODO Check this + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_STRING); // TODO Check this } if (track_list.reload_track_designs) @@ -746,7 +745,7 @@ public: rct_window* WindowTrackListOpen(const RideSelection item) { - window_close_construction_windows(); + WindowCloseConstructionWindows(); ScreenCoordsXY screenPos{}; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index d9923d21e6..1916b32b6b 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -93,9 +93,9 @@ public: void OnOpen() override { widgets = window_transparency_main_widgets; - window_push_others_below(*this); + WindowPushOthersBelow(*this); - auto* w = window_get_main(); + auto* w = WindowGetMain(); if (w != nullptr) windowPos.x = ((w->width / 2) - (width / 2)); } @@ -116,7 +116,7 @@ public: void OnPrepareDraw() override { uint32_t wflags = 0; - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); pressed_widgets = 0; disabled_widgets = 0; @@ -170,7 +170,7 @@ private: void ToggleViewportFlag(WidgetIndex widgetIndex) { uint32_t wflags = 0; - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w == nullptr) return; @@ -246,7 +246,7 @@ private: rct_window* WindowTransparencyOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::Transparency); + auto* window = WindowBringToFrontByClass(WindowClass::Transparency); if (window == nullptr) window = WindowCreate(WindowClass::Transparency, ScreenCoordsXY(32, 32), WW, WH); diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 079ad60ad8..2658b0b131 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -86,12 +86,12 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(*this); + WindowClose(*this); break; case WIDX_CLIP_CHECKBOX_ENABLE: { // Toggle height clipping. - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; @@ -114,7 +114,7 @@ public: break; case WIDX_CLIP_SELECTOR: // Activate the selection tool - tool_set(*this, WIDX_BACKGROUND, Tool::Crosshair); + ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); _toolActive = true; _dragging = false; @@ -129,7 +129,7 @@ public: if (IsActive()) { _toolActive = false; - tool_cancel(); + ToolCancel(); } gClipSelectionA = { 0, 0 }; gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; @@ -147,14 +147,14 @@ public: case WIDX_CLIP_HEIGHT_INCREASE: if (gClipHeight < 255) SetClipHeight(gClipHeight + 1); - mainWindow = window_get_main(); + mainWindow = WindowGetMain(); if (mainWindow != nullptr) mainWindow->Invalidate(); break; case WIDX_CLIP_HEIGHT_DECREASE: if (gClipHeight > 0) SetClipHeight(gClipHeight - 1); - mainWindow = window_get_main(); + mainWindow = WindowGetMain(); if (mainWindow != nullptr) mainWindow->Invalidate(); break; @@ -173,7 +173,7 @@ public: gClipHeight = clip_height; // Update the main window accordingly. - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { mainWindow->Invalidate(); @@ -188,7 +188,7 @@ public: gClipSelectionB = _previousClipSelectionB; } - widget_invalidate(*this, WIDX_CLIP_HEIGHT_SLIDER); + WidgetInvalidate(*this, WIDX_CLIP_HEIGHT_SLIDER); } void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override @@ -248,7 +248,7 @@ public: gClipSelectionA = gMapSelectPositionA; gClipSelectionB = gMapSelectPositionB; _toolActive = false; - tool_cancel(); + ToolCancel(); GfxInvalidateScreen(); } @@ -256,7 +256,7 @@ public: { WidgetScrollUpdateThumbs(*this, WIDX_CLIP_HEIGHT_SLIDER); - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { WidgetSetCheckboxValue(*this, WIDX_CLIP_CHECKBOX_ENABLE, mainWindow->viewport->flags & VIEWPORT_FLAG_CLIP_VIEW); @@ -352,10 +352,10 @@ public: // Initialise the clip height slider from the current clip height value. this->SetClipHeight(gClipHeight); - window_push_others_below(*this); + WindowPushOthersBelow(*this); // Get the main viewport to set the view clipping flag. - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); // Turn on view clipping when the window is opened. if (mainWindow != nullptr) @@ -369,7 +369,7 @@ private: void OnClose() override { // Turn off view clipping when the window is closed. - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; @@ -398,7 +398,7 @@ private: rct_window* WindowViewClippingOpen() { - auto* window = window_bring_to_front_by_class(WindowClass::ViewClipping); + auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping); if (window == nullptr) { window = WindowCreate(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), WW, WH); diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 7d59fcb443..da1e088255 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -59,7 +59,7 @@ private: void GetFreeViewportNumber() { number = 1; - window_visit_each([&](rct_window* w) { + WindowVisitEach([&](rct_window* w) { if (w != nullptr && w != this && w->classification == WindowClass::Viewport) { if (w->number >= number) @@ -84,7 +84,7 @@ public: return; } - auto* mainWindow = window_get_main(); + auto* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { rct_viewport* mainViewport = mainWindow->viewport; @@ -103,7 +103,7 @@ public: void OnUpdate() override { - auto* mainWindow = window_get_main(); + auto* mainWindow = WindowGetMain(); if (mainWindow == nullptr) return; @@ -139,12 +139,12 @@ public: } break; case WIDX_LOCATE: - auto* mainWindow = window_get_main(); + auto* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { auto info = get_map_coordinates_from_pos( { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); - window_scroll_to_location(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); + WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); } break; } @@ -156,7 +156,7 @@ public: // Draw viewport if (viewport != nullptr) - window_draw_viewport(&dpi, *this); + WindowDrawViewport(&dpi, *this); } void OnResize() override @@ -170,7 +170,7 @@ public: min_width = WW; min_height = WH; - window_set_resize(*this, min_width, min_height, max_width, max_height); + WindowSetResize(*this, min_width, min_height, max_width, max_height); } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index b519e8cac2..bd4cb7c50b 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -48,7 +48,7 @@ public: widgets = window_water_widgets; hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); - window_push_others_below(*this); + WindowPushOthersBelow(*this); gLandToolSize = 1; gWaterToolRaiseCost = MONEY64_UNDEFINED; @@ -60,7 +60,7 @@ public: // If the tool wasn't changed, turn tool off if (WaterToolIsActive()) { - tool_cancel(); + ToolCancel(); } } diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 3c69620395..89d265950c 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -185,7 +185,7 @@ namespace OpenRCT2 #ifndef DISABLE_NETWORK _network.Close(); #endif - window_close_all(); + WindowCloseAll(); // Unload objects after closing all windows, this is to overcome windows like // the object selection window which loads objects when closed. @@ -546,7 +546,7 @@ namespace OpenRCT2 } } - window_check_all_valid_zoom(); + WindowCheckAllValidZoom(); } void DisposeDrawingEngine() final override @@ -1114,7 +1114,7 @@ namespace OpenRCT2 Tick(); // Always run this at a fixed rate, Update can cause multiple ticks if the game is speed up. - window_update_all(); + WindowUpdateAll(); _ticksAccumulator -= GAME_UPDATE_TIME_MS; } @@ -1143,7 +1143,7 @@ namespace OpenRCT2 Tick(); // Always run this at a fixed rate, Update can cause multiple ticks if the game is speed up. - window_update_all(); + WindowUpdateAll(); _ticksAccumulator -= GAME_UPDATE_TIME_MS; diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 02f972dff4..695a710e37 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -124,7 +124,7 @@ namespace Editor */ void ConvertSaveToScenario() { - tool_cancel(); + ToolCancel(); auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(ConvertSaveToScenarioCallback)); @@ -221,7 +221,7 @@ namespace Editor { // #4996: Make sure the object selection window closes here to prevent unload objects // after we have loaded a new park. - window_close_all(); + WindowCloseAll(); auto extension = get_file_extension_type(path); switch (extension) @@ -362,12 +362,12 @@ namespace Editor switch (gEditorStep) { case EditorStep::ObjectSelection: - if (window_find_by_class(WindowClass::EditorObjectSelection) != nullptr) + if (WindowFindByClass(WindowClass::EditorObjectSelection) != nullptr) { return; } - if (window_find_by_class(WindowClass::InstallTrack) != nullptr) + if (WindowFindByClass(WindowClass::InstallTrack) != nullptr) { return; } @@ -380,7 +380,7 @@ namespace Editor ContextOpenWindow(WindowClass::EditorObjectSelection); break; case EditorStep::InventionsListSetUp: - if (window_find_by_class(WindowClass::EditorInventionList) != nullptr) + if (WindowFindByClass(WindowClass::EditorInventionList) != nullptr) { return; } @@ -388,7 +388,7 @@ namespace Editor ContextOpenWindow(WindowClass::EditorInventionList); break; case EditorStep::OptionsSelection: - if (window_find_by_class(WindowClass::EditorScenarioOptions) != nullptr) + if (WindowFindByClass(WindowClass::EditorScenarioOptions) != nullptr) { return; } @@ -396,7 +396,7 @@ namespace Editor ContextOpenWindow(WindowClass::EditorScenarioOptions); break; case EditorStep::ObjectiveSelection: - if (window_find_by_class(WindowClass::EditorObjectiveOptions) != nullptr) + if (WindowFindByClass(WindowClass::EditorObjectiveOptions) != nullptr) { return; } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 589e500524..af5ba1cb14 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -97,7 +97,7 @@ using namespace OpenRCT2; void game_reset_speed() { gGameSpeed = 1; - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); } void game_increase_game_speed() @@ -105,7 +105,7 @@ void game_increase_game_speed() gGameSpeed = std::min(gConfigGeneral.DebuggingTools ? 5 : 4, gGameSpeed + 1); if (gGameSpeed == 5) gGameSpeed = 8; - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); } void game_reduce_game_speed() @@ -113,7 +113,7 @@ void game_reduce_game_speed() gGameSpeed = std::max(1, gGameSpeed - 1); if (gGameSpeed == 7) gGameSpeed = 4; - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); } /** @@ -125,7 +125,7 @@ void game_create_windows() ContextOpenWindow(WindowClass::MainWindow); ContextOpenWindow(WindowClass::TopToolbar); ContextOpenWindow(WindowClass::BottomToolbar); - window_resize_gui(ContextGetWidth(), ContextGetHeight()); + WindowResizeGui(ContextGetWidth(), ContextGetHeight()); } enum @@ -302,7 +302,7 @@ void update_palette_effects() void pause_toggle() { gGamePaused ^= GAME_PAUSED_NORMAL; - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); if (gGamePaused & GAME_PAUSED_NORMAL) { OpenRCT2::Audio::StopAll(); @@ -471,8 +471,8 @@ void game_load_init() } else { - auto* mainWindow = window_get_main(); - window_unfollow_sprite(*mainWindow); + auto* mainWindow = WindowGetMain(); + WindowUnfollowSprite(*mainWindow); } auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); @@ -497,7 +497,7 @@ void game_load_init() { intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); ContextBroadcastIntent(&intent); - window_update_all(); + WindowUpdateAll(); } OpenRCT2::Audio::StopTitleMusic(); @@ -727,7 +727,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8 { game_notify_map_change(); game_unload_scripts(); - window_close_by_class(WindowClass::EditorObjectSelection); + WindowCloseByClass(WindowClass::EditorObjectSelection); GetContext()->LoadParkFromFile(path); game_load_scripts(); game_notify_map_changed(); @@ -738,7 +738,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8 static void NewGameWindowCallback(const utf8* path) { - window_close_by_class(WindowClass::EditorObjectSelection); + WindowCloseByClass(WindowClass::EditorObjectSelection); game_notify_map_change(); GetContext()->LoadParkFromFile(path, false, true); game_load_scripts(); @@ -757,7 +757,7 @@ void game_load_or_quit_no_save_prompt() { auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt); GameActions::Execute(&loadOrQuitAction); - tool_cancel(); + ToolCancel(); if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { load_landscape(); @@ -775,7 +775,7 @@ void game_load_or_quit_no_save_prompt() { auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt); GameActions::Execute(&loadOrQuitAction); - tool_cancel(); + ToolCancel(); if (input_test_flag(INPUT_FLAG_5)) { input_set_flag(INPUT_FLAG_5, false); @@ -791,7 +791,7 @@ void game_load_or_quit_no_save_prompt() { auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt); GameActions::Execute(&loadOrQuitAction); - tool_cancel(); + ToolCancel(); auto intent = Intent(WindowClass::ScenarioSelect); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(NewGameWindowCallback)); ContextOpenIntent(&intent); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 38c5750c7a..8430593622 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -240,7 +240,7 @@ void GameState::Tick() scenario_autosave_check(); } - window_dispatch_update_all(); + WindowDispatchUpdateAll(); if (didRunSingleFrame && game_is_not_paused() && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 9c8d525aa0..fef4678ff0 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -853,9 +853,9 @@ namespace OpenRCT2 // Focus camera on event. if (isPositionValid && !result.Position.IsNull()) { - auto* mainWindow = window_get_main(); + auto* mainWindow = WindowGetMain(); if (mainWindow != nullptr) - window_scroll_to_location(*mainWindow, result.Position); + WindowScrollToLocation(*mainWindow, result.Position); } replayQueue.erase(replayQueue.begin()); diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 1d536255d0..7fe97d9a45 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -92,13 +92,13 @@ GameActions::Result CheatSetAction::Execute() const { case CheatType::SandboxMode: gCheatsSandboxMode = _param1 != 0; - window_invalidate_by_class(WindowClass::Map); - window_invalidate_by_class(WindowClass::Footpath); + WindowInvalidateByClass(WindowClass::Map); + WindowInvalidateByClass(WindowClass::Footpath); break; case CheatType::DisableClearanceChecks: gCheatsDisableClearanceChecks = _param1 != 0; // Required to update the clearance checks overlay on the Cheats button. - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); break; case CheatType::DisableSupportLimits: gCheatsDisableSupportLimits = _param1 != 0; @@ -217,7 +217,7 @@ GameActions::Result CheatSetAction::Execute() const break; case CheatType::AllowArbitraryRideTypeChanges: gCheatsAllowArbitraryRideTypeChanges = _param1 != 0; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); break; case CheatType::OwnAllLand: OwnAllLand(); @@ -256,7 +256,7 @@ GameActions::Result CheatSetAction::Execute() const ConfigSaveDefault(); } - window_invalidate_by_class(WindowClass::Cheats); + WindowInvalidateByClass(WindowClass::Cheats); return GameActions::Result(); } @@ -468,7 +468,7 @@ void CheatSetAction::RenewRides() const { ride.Renew(); } - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); } void CheatSetAction::MakeDestructible() const @@ -478,7 +478,7 @@ void CheatSetAction::MakeDestructible() const ride.lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE; ride.lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; } - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); } void CheatSetAction::ResetRideCrashStatus() const @@ -489,7 +489,7 @@ void CheatSetAction::ResetRideCrashStatus() const ride.lifecycle_flags &= ~RIDE_LIFECYCLE_CRASHED; ride.last_crash_type = RIDE_CRASH_TYPE_NONE; } - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); } void CheatSetAction::Set10MinuteInspection() const @@ -499,7 +499,7 @@ void CheatSetAction::Set10MinuteInspection() const // Set inspection interval to 10 minutes ride.inspection_interval = RIDE_INSPECTION_EVERY_10_MINUTES; } - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); } void CheatSetAction::SetScenarioNoMoney(bool enabled) const @@ -513,29 +513,29 @@ void CheatSetAction::SetScenarioNoMoney(bool enabled) const gParkFlags &= ~PARK_FLAGS_NO_MONEY; } // Invalidate all windows that have anything to do with finance - window_invalidate_by_class(WindowClass::Ride); - window_invalidate_by_class(WindowClass::Peep); - window_invalidate_by_class(WindowClass::ParkInformation); - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); - window_invalidate_by_class(WindowClass::TopToolbar); - window_invalidate_by_class(WindowClass::Cheats); + WindowInvalidateByClass(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Peep); + WindowInvalidateByClass(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::Cheats); } void CheatSetAction::SetMoney(money64 amount) const { gCash = amount; - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); } void CheatSetAction::AddMoney(money64 amount) const { gCash = add_clamp_money64(gCash, amount); - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); } void CheatSetAction::ClearLoan() const @@ -555,7 +555,7 @@ void CheatSetAction::GenerateGuests(int32_t count) const { park.GenerateGuest(); } - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::BottomToolbar); } void CheatSetAction::SetGuestParameter(int32_t parameter, int32_t value) const @@ -626,7 +626,7 @@ void CheatSetAction::GiveObjectToGuests(int32_t object) const break; } } - window_invalidate_by_class(WindowClass::Peep); + WindowInvalidateByClass(WindowClass::Peep); } void CheatSetAction::RemoveAllGuests() const @@ -673,7 +673,7 @@ void CheatSetAction::RemoveAllGuests() const guest->Remove(); } - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); GfxInvalidateScreen(); } diff --git a/src/openrct2/actions/LoadOrQuitAction.cpp b/src/openrct2/actions/LoadOrQuitAction.cpp index ae84113eca..3fccbefb27 100644 --- a/src/openrct2/actions/LoadOrQuitAction.cpp +++ b/src/openrct2/actions/LoadOrQuitAction.cpp @@ -51,7 +51,7 @@ GameActions::Result LoadOrQuitAction::Execute() const ContextOpenWindow(WindowClass::SavePrompt); break; case LoadOrQuitModes::CloseSavePrompt: - window_close_by_class(WindowClass::SavePrompt); + WindowCloseByClass(WindowClass::SavePrompt); break; default: game_load_or_quit_no_save_prompt(); diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index 9f0d861c80..4af6160ecb 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -55,6 +55,6 @@ GameActions::Result ParkSetEntranceFeeAction::Query() const GameActions::Result ParkSetEntranceFeeAction::Execute() const { gParkEntranceFee = _fee; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); return GameActions::Result(); } diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index b304770939..c8e29a57ff 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -57,19 +57,19 @@ GameActions::Result ParkSetParameterAction::Execute() const if (gParkFlags & PARK_FLAGS_PARK_OPEN) { gParkFlags &= ~PARK_FLAGS_PARK_OPEN; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } break; case ParkParameter::Open: if (!(gParkFlags & PARK_FLAGS_PARK_OPEN)) { gParkFlags |= PARK_FLAGS_PARK_OPEN; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } break; case ParkParameter::SamePriceInPark: gSamePriceThroughoutPark = _value; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); break; default: return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 2638e88672..d7075977df 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -200,5 +200,5 @@ void PeepPickupAction::CancelConcurrentPickups(Peep* pickedPeep) const // By assigning the peep to null before calling tool_cancel we can avoid // resetting the peep to the initial position. network_set_pickup_peep(currentPlayerId, nullptr); - tool_cancel(); + ToolCancel(); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index e8dbc2f00f..9afac2767e 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -319,7 +319,7 @@ GameActions::Result RideCreateAction::Execute() const ride->MinCarsPerTrain = rideEntry->min_cars_in_train; ride->MaxCarsPerTrain = rideEntry->max_cars_in_train; ride_set_vehicle_colours_to_random_preset(*ride, _colour2); - window_invalidate_by_class(WindowClass::RideList); + WindowInvalidateByClass(WindowClass::RideList); res.Expenditure = ExpenditureType::RideConstruction; res.SetData(RideId{ rideIndex }); diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index d8b7d54132..dd4c997cf9 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -157,10 +157,10 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const gParkValue = GetContext()->GetGameState()->GetPark().CalculateParkValue(); // Close windows related to the demolished ride - window_close_by_number(WindowClass::RideConstruction, rideId.ToUnderlying()); - window_close_by_number(WindowClass::Ride, rideId.ToUnderlying()); - window_close_by_number(WindowClass::DemolishRidePrompt, rideId.ToUnderlying()); - window_close_by_class(WindowClass::NewCampaign); + WindowCloseByNumber(WindowClass::RideConstruction, rideId.ToUnderlying()); + WindowCloseByNumber(WindowClass::Ride, rideId.ToUnderlying()); + WindowCloseByNumber(WindowClass::DemolishRidePrompt, rideId.ToUnderlying()); + WindowCloseByClass(WindowClass::NewCampaign); // Refresh windows that display the ride name auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); @@ -284,7 +284,7 @@ GameActions::Result RideDemolishAction::RefurbishRide(Ride& ride) const res.Position = { location, TileElementHeight(location) }; } - window_close_by_number(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying()); + WindowCloseByNumber(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying()); return res; } diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index ee31463943..b097a5fd9c 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -66,7 +66,7 @@ GameActions::Result RideFreezeRatingAction::Execute() const ride->lifecycle_flags |= RIDE_LIFECYCLE_FIXED_RATINGS; - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); auto res = GameActions::Result(); return res; diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index eaf211561e..b678fd9c54 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -142,7 +142,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const ride->SetLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS, static_cast(_value)); break; } - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); auto res = GameActions::Result(); if (!ride->overall_view.IsNull()) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 97c128e946..2a138a3e31 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -105,7 +105,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (shopItem == ShopItem::None) { ride->price[0] = _price; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); return res; } } @@ -113,7 +113,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (!shop_item_has_common_price(shopItem)) { ride->price[0] = _price; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); return res; } } @@ -126,7 +126,7 @@ GameActions::Result RideSetPriceAction::Execute() const if ((ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0) { ride->price[1] = _price; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); return res; } } @@ -134,7 +134,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (!shop_item_has_common_price(shopItem)) { ride->price[1] = _price; - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Ride); return res; } } @@ -183,7 +183,7 @@ void RideSetPriceAction::RideSetCommonPrice(ShopItem shopItem) const } if (invalidate) { - window_invalidate_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); } } } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index c43db315ef..5d92868295 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -236,7 +236,7 @@ GameActions::Result RideSetSettingAction::Execute() const auto location = ride->overall_view.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); return res; } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index d98cb4b28c..80ccbd95f2 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -159,7 +159,7 @@ GameActions::Result RideSetStatusAction::Execute() const ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; ride->race_winner = EntityId::GetNull(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; case RideStatus::Simulating: { @@ -182,7 +182,7 @@ GameActions::Result RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; } case RideStatus::Testing: @@ -201,10 +201,10 @@ GameActions::Result RideSetStatusAction::Execute() const // Fix #3183: Make sure we close the construction window so the ride finishes any editing code before opening // otherwise vehicles get added to the ride incorrectly (such as to a ghost station) - rct_window* constructionWindow = window_find_by_number(WindowClass::RideConstruction, _rideIndex.ToUnderlying()); + rct_window* constructionWindow = WindowFindByNumber(WindowClass::RideConstruction, _rideIndex.ToUnderlying()); if (constructionWindow != nullptr) { - window_close(*constructionWindow); + WindowClose(*constructionWindow); } if (_status == RideStatus::Testing) @@ -234,7 +234,7 @@ GameActions::Result RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; } default: diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 17e3a1d77d..b5b14ae9ff 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -70,33 +70,33 @@ GameActions::Result ScenarioSetSettingAction::Execute() const gParkFlags &= ~PARK_FLAGS_NO_MONEY; } // Invalidate all windows that have anything to do with finance - window_invalidate_by_class(WindowClass::Ride); - window_invalidate_by_class(WindowClass::Peep); - window_invalidate_by_class(WindowClass::ParkInformation); - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); - window_invalidate_by_class(WindowClass::TopToolbar); + WindowInvalidateByClass(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::Peep); + WindowInvalidateByClass(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::TopToolbar); } break; case ScenarioSetSetting::InitialCash: gInitialCash = std::clamp(_value, 0.00_GBP, 1000000.00_GBP); gCash = gInitialCash; - window_invalidate_by_class(WindowClass::Finances); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); break; case ScenarioSetSetting::InitialLoan: gBankLoan = std::clamp(_value, 0.00_GBP, 5000000.00_GBP); gMaxBankLoan = std::max(gBankLoan, gMaxBankLoan); - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); break; case ScenarioSetSetting::MaximumLoanSize: gMaxBankLoan = std::clamp(_value, 0.00_GBP, 5000000.00_GBP); gBankLoan = std::min(gBankLoan, gMaxBankLoan); - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); break; case ScenarioSetSetting::AnnualInterestRate: gBankLoanInterestRate = std::clamp(_value, 0, MaxBankLoanInterestRate); - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); break; case ScenarioSetSetting::ForbidMarketingCampaigns: if (_value != 0) @@ -185,13 +185,13 @@ GameActions::Result ScenarioSetSettingAction::Execute() const gParkFlags |= PARK_FLAGS_PARK_FREE_ENTRY; gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES; } - window_invalidate_by_class(WindowClass::ParkInformation); - window_invalidate_by_class(WindowClass::Ride); + WindowInvalidateByClass(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::Ride); } break; case ScenarioSetSetting::ParkChargeEntryFee: gParkEntranceFee = std::clamp(_value, 0.00_GBP, MAX_ENTRANCE_FEE); - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); break; case ScenarioSetSetting::ForbidTreeRemoval: if (_value != 0) @@ -250,6 +250,6 @@ GameActions::Result ScenarioSetSettingAction::Execute() const log_error("Invalid setting: %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } - window_invalidate_by_class(WindowClass::EditorScenarioOptions); + WindowInvalidateByClass(WindowClass::EditorScenarioOptions); return GameActions::Result(); } diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index b64750bd63..004d6a6143 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -60,7 +60,7 @@ GameActions::Result StaffFireAction::Execute() const log_error("Invalid spriteId. spriteId = %u", _spriteId); return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } - window_close_by_class(WindowClass::FirePrompt); + WindowCloseByClass(WindowClass::FirePrompt); peep_sprite_remove(staff); // Due to patrol areas best to invalidate the whole screen on removal of staff GfxInvalidateScreen(); diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index b2056d40ba..67172f9e4e 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -103,7 +103,7 @@ GameActions::Result StaffSetCostumeAction::Execute() const staff->UpdateCurrentActionSpriteType(); staff->Invalidate(); - window_invalidate_by_number(WindowClass::Peep, _spriteIndex); + WindowInvalidateByNumber(WindowClass::Peep, _spriteIndex); auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST); ContextBroadcastIntent(&intent); diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 7c477e9ed4..d56ee2db26 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -69,7 +69,7 @@ GameActions::Result StaffSetOrdersAction::Execute() const } staff->StaffOrders = _ordersId; - window_invalidate_by_number(WindowClass::Peep, _spriteIndex); + WindowInvalidateByNumber(WindowClass::Peep, _spriteIndex); auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST); ContextBroadcastIntent(&intent); diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index b776f909a3..9c92bac205 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -177,7 +177,7 @@ namespace OpenRCT2::Audio auto pos2 = Translate3DTo2DWithZ(rotation, location); rct_viewport* viewport = nullptr; - while ((viewport = window_get_previous_viewport(viewport)) != nullptr) + while ((viewport = WindowGetPreviousViewport(viewport)) != nullptr) { if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) { @@ -406,7 +406,7 @@ namespace OpenRCT2::Audio Pause(); } - window_invalidate_by_class(WindowClass::Options); + WindowInvalidateByClass(WindowClass::Options); } void Pause() diff --git a/src/openrct2/cmdline/ConvertCommand.cpp b/src/openrct2/cmdline/ConvertCommand.cpp index a0417d70f5..24f70cea7b 100644 --- a/src/openrct2/cmdline/ConvertCommand.cpp +++ b/src/openrct2/cmdline/ConvertCommand.cpp @@ -118,7 +118,7 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato // HACK remove the main window so it saves the park with the // correct initial view - window_close_by_class(WindowClass::MainWindow); + WindowCloseByClass(WindowClass::MainWindow); exporter->Export(destinationPath); } diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index e5ed3fedaf..be49eb7e1c 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -294,7 +294,7 @@ void lightfx_prepare_light_list() ViewportInteractionItem interactionType = ViewportInteractionItem::None; - auto* w = window_get_main(); + auto* w = WindowGetMain(); if (w != nullptr) { // based on get_map_coordinates_from_pos_window @@ -432,10 +432,10 @@ void lightfx_swap_buffers() void lightfx_update_viewport_settings() { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - rct_viewport* viewport = window_get_viewport(mainWindow); + rct_viewport* viewport = WindowGetViewport(mainWindow); _current_view_x_back = viewport->viewPos.x; _current_view_y_back = viewport->viewPos.y; _current_view_rotation_back = get_current_rotation(); diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index 8a18d24cfc..822ee69e60 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -57,7 +57,7 @@ void DrawWeather(rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer) { uint32_t viewFlags = 0; - const auto* viewport = window_get_viewport(window_get_main()); + const auto* viewport = WindowGetViewport(WindowGetMain()); if (viewport != nullptr) viewFlags = viewport->flags; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 8c72e56c37..ba6cf2883b 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -203,12 +203,12 @@ void X8DrawingEngine::EndDraw() void X8DrawingEngine::PaintWindows() { - window_reset_visibilities(); + WindowResetVisibilities(); // Redraw dirty regions before updating the viewports, otherwise // when viewports get panned, they copy dirty pixels DrawAllDirtyBlocks(); - window_update_all_viewports(); + WindowUpdateAllViewports(); DrawAllDirtyBlocks(); } @@ -437,7 +437,7 @@ void X8DrawingEngine::DrawDirtyBlocks(uint32_t x, uint32_t y, uint32_t columns, // Draw region OnDrawDirtyBlock(x, y, columns, rows); - window_draw_all(&_bitsDPI, left, top, right, bottom); + WindowDrawAll(&_bitsDPI, left, top, right, bottom); } #ifdef __WARN_SUGGEST_FINAL_METHODS__ diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 1f06f20d22..f338234c36 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1419,14 +1419,14 @@ void Guest::CheckCantFindRide() return; GuestHeadingToRideId = RideId::GetNull(); - rct_window* w = window_find_by_number(WindowClass::Peep, sprite_index); + rct_window* w = WindowFindByNumber(WindowClass::Peep, sprite_index); if (w != nullptr) { - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); } - window_invalidate_by_number(WindowClass::Peep, sprite_index); + WindowInvalidateByNumber(WindowClass::Peep, sprite_index); } /** @@ -2293,7 +2293,7 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp peep_expend_type += static_cast(amount); - window_invalidate_by_number(WindowClass::Peep, sprite_index); + WindowInvalidateByNumber(WindowClass::Peep, sprite_index); finance_payment(-amount, expenditure); @@ -3109,10 +3109,10 @@ static void peep_leave_park(Guest* peep) peep->InsertNewThought(PeepThoughtType::GoHome); - rct_window* w = window_find_by_number(WindowClass::Peep, peep->sprite_index); + rct_window* w = WindowFindByNumber(WindowClass::Peep, peep->sprite_index); if (w != nullptr) - window_event_invalidate_call(w); - window_invalidate_by_number(WindowClass::Peep, peep->sprite_index); + WindowEventInvalidateCall(w); + WindowInvalidateByNumber(WindowClass::Peep, peep->sprite_index); } template static void peep_head_for_nearest_ride(Guest* peep, bool considerOnlyCloseRides, T predicate) @@ -3344,7 +3344,7 @@ void Guest::UpdateBuying() { CashInPocket += 50.00_GBP; } - window_invalidate_by_number(WindowClass::Peep, sprite_index); + WindowInvalidateByNumber(WindowClass::Peep, sprite_index); } sprite_direction ^= 0x10; @@ -3839,7 +3839,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) if (queueTime != station.QueueTime) { station.QueueTime = queueTime; - window_invalidate_by_number(WindowClass::Ride, CurrentRide.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, CurrentRide.ToUnderlying()); } if (PeepFlags & PEEP_FLAGS_TRACKING) @@ -5670,7 +5670,7 @@ void Guest::UpdateLeavingPark() ContextBroadcastIntent(&intent); Var37 = 1; - window_invalidate_by_class(WindowClass::GuestList); + WindowInvalidateByClass(WindowClass::GuestList); uint8_t pathingResult; PerformNextAction(pathingResult); if (!(pathingResult & PATHING_OUTSIDE_PARK)) diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 47d69520a7..4302370d80 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -83,11 +83,11 @@ void MoneyEffect::Create(money64 value, const CoordsXYZ& loc) return; } - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow == nullptr) return; - rct_viewport* mainViewport = window_get_viewport(mainWindow); + rct_viewport* mainViewport = WindowGetViewport(mainWindow); auto mapPositionXY = screen_get_map_xy( { mainViewport->pos.x + (mainViewport->width / 2), mainViewport->pos.y + (mainViewport->height / 2) }, nullptr); if (!mapPositionXY.has_value()) diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 717bcec5f1..d14b7faa85 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -564,9 +564,9 @@ void peep_decrement_num_riders(Peep* peep) */ void peep_window_state_update(Peep* peep) { - rct_window* w = window_find_by_number(WindowClass::Peep, peep->sprite_index.ToUnderlying()); + rct_window* w = WindowFindByNumber(WindowClass::Peep, peep->sprite_index.ToUnderlying()); if (w != nullptr) - window_event_invalidate_call(w); + WindowEventInvalidateCall(w); if (peep->Is()) { @@ -580,13 +580,13 @@ void peep_window_state_update(Peep* peep) } } - window_invalidate_by_number(WindowClass::Peep, peep->sprite_index); - window_invalidate_by_class(WindowClass::GuestList); + WindowInvalidateByNumber(WindowClass::Peep, peep->sprite_index); + WindowInvalidateByClass(WindowClass::GuestList); } else { - window_invalidate_by_number(WindowClass::Peep, peep->sprite_index); - window_invalidate_by_class(WindowClass::StaffList); + WindowInvalidateByNumber(WindowClass::Peep, peep->sprite_index); + WindowInvalidateByClass(WindowClass::StaffList); } } @@ -692,9 +692,9 @@ void peep_sprite_remove(Peep* peep) } peep->Invalidate(); - window_close_by_number(WindowClass::Peep, peep->sprite_index); + WindowCloseByNumber(WindowClass::Peep, peep->sprite_index); - window_close_by_number(WindowClass::FirePrompt, EnumValue(peep->Type)); + WindowCloseByNumber(WindowClass::FirePrompt, EnumValue(peep->Type)); auto* staff = peep->As(); // Needed for invalidations after sprite removal @@ -1982,7 +1982,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin } gTotalAdmissions++; - window_invalidate_by_number(WindowClass::ParkInformation, 0); + WindowInvalidateByNumber(WindowClass::ParkInformation, 0); guest->Var37 = 1; auto destination = guest->GetDestination(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index f03b62c3cf..04123d460c 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -673,10 +673,10 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "location") { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { - rct_viewport* viewport = window_get_viewport(w); + rct_viewport* viewport = WindowGetViewport(w); auto info = get_map_coordinates_from_pos( { viewport->view_width / 2, viewport->view_height / 2 }, EnumsToFlags(ViewportInteractionItem::Terrain)); @@ -1052,7 +1052,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "location" && invalidArguments(&invalidArgs, int_valid[0] && int_valid[1])) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre(); @@ -1074,7 +1074,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "window_limit" && invalidArguments(&invalidArgs, int_valid[0])) { - window_set_window_limit(int_val[0]); + WindowSetWindowLimit(int_val[0]); console.Execute("get window_limit"); } else if (argv[0] == "render_weather_effects" && invalidArguments(&invalidArgs, int_valid[0])) @@ -1146,7 +1146,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) else if (argv[0] == "current_rotation" && invalidArguments(&invalidArgs, int_valid[0])) { uint8_t currentRotation = get_current_rotation(); - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); int32_t newRotation = int_val[0]; if (newRotation < 0 || newRotation > 3) { @@ -1154,7 +1154,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (newRotation != currentRotation && mainWindow != nullptr) { - window_rotate_camera(*mainWindow, newRotation - currentRotation); + WindowRotateCamera(*mainWindow, newRotation - currentRotation); } console.Execute("get current_rotation"); } @@ -1328,7 +1328,7 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) else { // Only this window should be open for safety reasons - window_close_all(); + WindowCloseAll(); ContextOpenWindow(WindowClass::EditorObjectSelection); } } @@ -1485,7 +1485,7 @@ static int32_t cc_for_date([[maybe_unused]] InteractiveConsole& console, [[maybe } date_set(year, month, day); - window_invalidate_by_class(WindowClass::BottomToolbar); + WindowInvalidateByClass(WindowClass::BottomToolbar); return 1; } diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index f3c20756f8..9489a53cfc 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -298,8 +298,8 @@ static rct_viewport GetGiantViewport(int32_t rotation, ZoomLevel zoom) }, }; - auto* const mainWindow = window_get_main(); - const auto* const mainViewport = window_get_viewport(mainWindow); + auto* const mainWindow = WindowGetMain(); + const auto* const mainViewport = WindowGetViewport(mainWindow); const bool useViewClipping = (mainViewport != nullptr && mainViewport->flags & VIEWPORT_FLAG_CLIP_VIEW); // Calculate the viewport bounds @@ -352,8 +352,8 @@ void screenshot_giant() const auto rotation = get_current_rotation(); auto zoom = ZoomLevel{ 0 }; - auto* mainWindow = window_get_main(); - const auto* vp = window_get_viewport(mainWindow); + auto* mainWindow = WindowGetMain(); + const auto* vp = WindowGetViewport(mainWindow); if (mainWindow != nullptr && vp != nullptr) { zoom = vp->zoom; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 67ea509cb6..a2c85d02d7 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -91,7 +91,7 @@ void viewport_init_all() colours_init_maps(); } - window_init_all(); + WindowInitAll(); // ? input_reset_flags(); @@ -101,7 +101,7 @@ void viewport_init_all() reset_tooltip_not_shown(); gMapSelectFlags = 0; ClearPatrolAreaToRender(); - textinput_cancel(); + TextinputCancel(); } /** @@ -291,7 +291,7 @@ static void viewport_redraw_after_shift( || viewport->pos.y + viewport->height <= window->windowPos.y || viewport->pos.y >= window->windowPos.y + window->height) { - auto itWindowPos = window_get_iterator(window); + auto itWindowPos = WindowGetIterator(window); auto itNextWindow = itWindowPos != g_window_list.end() ? std::next(itWindowPos) : g_window_list.end(); viewport_redraw_after_shift( dpi, itNextWindow == g_window_list.end() ? nullptr : itNextWindow->get(), viewport, coords); @@ -370,14 +370,14 @@ static void viewport_redraw_after_shift( { // draw left auto _right = viewport->pos.x + coords.x; - window_draw_all(dpi, left, top, _right, bottom); + WindowDrawAll(dpi, left, top, _right, bottom); left += coords.x; } else if (coords.x < 0) { // draw right auto _left = viewport->pos.x + viewport->width + coords.x; - window_draw_all(dpi, _left, top, right, bottom); + WindowDrawAll(dpi, _left, top, right, bottom); right += coords.x; } @@ -385,19 +385,19 @@ static void viewport_redraw_after_shift( { // draw top bottom = viewport->pos.y + coords.y; - window_draw_all(dpi, left, top, right, bottom); + WindowDrawAll(dpi, left, top, right, bottom); } else if (coords.y < 0) { // draw bottom top = viewport->pos.y + viewport->height + coords.y; - window_draw_all(dpi, left, top, right, bottom); + WindowDrawAll(dpi, left, top, right, bottom); } } else { // redraw whole viewport - window_draw_all(dpi, left, top, right, bottom); + WindowDrawAll(dpi, left, top, right, bottom); } } } @@ -405,7 +405,7 @@ static void viewport_redraw_after_shift( static void viewport_shift_pixels( rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int32_t x_diff, int32_t y_diff) { - auto it = window_get_iterator(window); + auto it = WindowGetIterator(window); for (; it != g_window_list.end(); it++) { auto w = it->get(); @@ -444,7 +444,7 @@ static void viewport_shift_pixels( if (top >= bottom) continue; - window_draw_all(dpi, left, top, right, bottom); + WindowDrawAll(dpi, left, top, right, bottom); } viewport_redraw_after_shift(dpi, window, viewport, { x_diff, y_diff }); @@ -481,7 +481,7 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp if (drawing_engine_has_dirty_optimisations()) { rct_drawpixelinfo* dpi = drawing_engine_get_dpi(); - window_draw_all(dpi, left, top, right, bottom); + WindowDrawAll(dpi, left, top, right, bottom); return; } } @@ -569,7 +569,7 @@ static void viewport_set_underground_flag(int32_t underground, rct_window* windo */ void viewport_update_position(rct_window* window) { - window_event_resize_call(window); + WindowEventResizeCall(window); rct_viewport* viewport = window->viewport; if (viewport == nullptr) @@ -1190,7 +1190,7 @@ void show_gridlines() { if (gShowGridLinesRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (!(mainWindow->viewport->flags & VIEWPORT_FLAG_GRIDLINES)) @@ -1214,7 +1214,7 @@ void hide_gridlines() if (gShowGridLinesRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (!gConfigGeneral.AlwaysShowGridlines) @@ -1234,7 +1234,7 @@ void show_land_rights() { if (gShowLandRightsRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (!(mainWindow->viewport->flags & VIEWPORT_FLAG_LAND_OWNERSHIP)) @@ -1258,7 +1258,7 @@ void hide_land_rights() if (gShowLandRightsRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (mainWindow->viewport->flags & VIEWPORT_FLAG_LAND_OWNERSHIP) @@ -1278,7 +1278,7 @@ void show_construction_rights() { if (gShowConstructionRightsRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (!(mainWindow->viewport->flags & VIEWPORT_FLAG_CONSTRUCTION_RIGHTS)) @@ -1302,7 +1302,7 @@ void hide_construction_rights() if (gShowConstructionRightsRefCount == 0) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { if (mainWindow->viewport->flags & VIEWPORT_FLAG_CONSTRUCTION_RIGHTS) @@ -1320,7 +1320,7 @@ void hide_construction_rights() */ void viewport_set_visibility(uint8_t mode) { - rct_window* window = window_get_main(); + rct_window* window = WindowGetMain(); if (window != nullptr) { @@ -1892,7 +1892,7 @@ InteractionInfo set_interaction_info_from_paint_session(PaintSession* session, u */ InteractionInfo get_map_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t flags) { - rct_window* window = window_find_from_point(screenCoords); + rct_window* window = WindowFindFromPoint(screenCoords); return get_map_coordinates_from_pos_window(window, screenCoords, flags); } @@ -1949,7 +1949,7 @@ void viewport_invalidate(const rct_viewport* viewport, const ScreenRect& screenR if (owner != nullptr && owner->classification != WindowClass::MainWindow) { // note, window_is_visible will update viewport->visibility, so this should have a low hit count - if (!window_is_visible(*owner)) + if (!WindowIsVisible(*owner)) { return; } @@ -1981,7 +1981,7 @@ void viewport_invalidate(const rct_viewport* viewport, const ScreenRect& screenR static rct_viewport* viewport_find_from_point(const ScreenCoordsXY& screenCoords) { - rct_window* w = window_find_from_point(screenCoords); + rct_window* w = WindowFindFromPoint(screenCoords); if (w == nullptr) return nullptr; @@ -2010,7 +2010,7 @@ static rct_viewport* viewport_find_from_point(const ScreenCoordsXY& screenCoords std::optional screen_get_map_xy(const ScreenCoordsXY& screenCoords, rct_viewport** viewport) { // This will get the tile location but we will need the more accuracy - rct_window* window = window_find_from_point(screenCoords); + rct_window* window = WindowFindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { return std::nullopt; @@ -2157,7 +2157,7 @@ int32_t get_height_marker_offset() void viewport_set_saved_view() { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { rct_viewport* viewport = w->viewport; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 0e718764a1..5d94a675fd 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -86,14 +86,14 @@ namespace WindowCloseFlags static void window_draw_core(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom); static void window_draw_single(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom); -std::list>::iterator window_get_iterator(const rct_window* w) +std::list>::iterator WindowGetIterator(const rct_window* w) { return std::find_if(g_window_list.begin(), g_window_list.end(), [w](const std::shared_ptr& w2) -> bool { return w == w2.get(); }); } -void window_visit_each(std::function func) +void WindowVisitEach(std::function func) { auto windowList = g_window_list; for (auto& w : windowList) @@ -106,16 +106,16 @@ void window_visit_each(std::function func) * * rct2: 0x006ED7B0 */ -void window_dispatch_update_all() +void WindowDispatchUpdateAll() { // gTooltipNotShownTicks++; - window_visit_each([&](rct_window* w) { window_event_update_call(w); }); + WindowVisitEach([&](rct_window* w) { WindowEventUpdateCall(w); }); } -void window_update_all_viewports() +void WindowUpdateAllViewports() { - window_visit_each([&](rct_window* w) { - if (w->viewport != nullptr && window_is_visible(*w)) + WindowVisitEach([&](rct_window* w) { + if (w->viewport != nullptr && WindowIsVisible(*w)) { viewport_update_position(w); } @@ -126,7 +126,7 @@ void window_update_all_viewports() * * rct2: 0x006E77A1 */ -void window_update_all() +void WindowUpdateAll() { // window_update_all_viewports(); @@ -136,11 +136,11 @@ void window_update_all() { gWindowUpdateTicks = 0; - window_visit_each([](rct_window* w) { window_event_periodic_update_call(w); }); + WindowVisitEach([](rct_window* w) { WindowEventPeriodicUpdateCall(w); }); } // Border flash invalidation - window_visit_each([](rct_window* w) { + WindowVisitEach([](rct_window* w) { if (w->flags & WF_WHITE_BORDER_MASK) { w->flags -= WF_WHITE_BORDER_ONE; @@ -178,14 +178,14 @@ static void window_close_surplus(int32_t cap, WindowClass avoid_classification) { continue; } - window_close(*foundW); + WindowClose(*foundW); } } /* * Changes the maximum amount of windows allowed */ -void window_set_window_limit(int32_t value) +void WindowSetWindowLimit(int32_t value) { int32_t prev = gConfigGeneral.WindowLimit; int32_t val = std::clamp(value, WINDOW_LIMIT_MIN, WINDOW_LIMIT_MAX); @@ -205,16 +205,16 @@ void window_set_window_limit(int32_t value) * * @param window The window to close (esi). */ -void window_close(rct_window& w) +void WindowClose(rct_window& w) { - auto itWindow = window_get_iterator(&w); + auto itWindow = WindowGetIterator(&w); if (itWindow == g_window_list.end()) return; // Explicit copy of the shared ptr to keep the memory valid. std::shared_ptr window = *itWindow; - window_event_close_call(window.get()); + WindowEventCloseCall(window.get()); // Remove viewport window->RemoveViewport(); @@ -223,7 +223,7 @@ void window_close(rct_window& w) window->Invalidate(); // The window list may have been modified in the close event - itWindow = window_get_iterator(&w); + itWindow = WindowGetIterator(&w); if (itWindow != g_window_list.end()) g_window_list.erase(itWindow); } @@ -245,7 +245,7 @@ template static void window_close_by_condition(TPred pred, uint3 // we need to break this current iteration and restart. size_t previousCount = g_window_list.size(); - window_close(*window.get()); + WindowClose(*window.get()); if ((flags & WindowCloseFlags::CloseSingle) != 0) { @@ -284,7 +284,7 @@ template static void window_close_by_condition(TPred pred, uint3 * rct2: 0x006ECCF4 * @param cls (cl) with bit 15 set */ -void window_close_by_class(WindowClass cls) +void WindowCloseByClass(WindowClass cls) { window_close_by_condition([&](rct_window* w) -> bool { return w->classification == cls; }); } @@ -295,15 +295,15 @@ void window_close_by_class(WindowClass cls) * @param cls (cl) without bit 15 set * @param number (dx) */ -void window_close_by_number(WindowClass cls, rct_windownumber number) +void WindowCloseByNumber(WindowClass cls, rct_windownumber number) { window_close_by_condition([cls, number](rct_window* w) -> bool { return w->classification == cls && w->number == number; }); } // TODO: Refactor this to use variant once the new window class is done. -void window_close_by_number(WindowClass cls, EntityId number) +void WindowCloseByNumber(WindowClass cls, EntityId number) { - window_close_by_number(cls, static_cast(number.ToUnderlying())); + WindowCloseByNumber(cls, static_cast(number.ToUnderlying())); } /** @@ -312,7 +312,7 @@ void window_close_by_number(WindowClass cls, EntityId number) * @param cls (cl) with bit 15 set * @returns the window or NULL if no window was found. */ -rct_window* window_find_by_class(WindowClass cls) +rct_window* WindowFindByClass(WindowClass cls) { for (auto& w : g_window_list) { @@ -331,7 +331,7 @@ rct_window* window_find_by_class(WindowClass cls) * @param number (dx) * @returns the window or NULL if no window was found. */ -rct_window* window_find_by_number(WindowClass cls, rct_windownumber number) +rct_window* WindowFindByNumber(WindowClass cls, rct_windownumber number) { for (auto& w : g_window_list) { @@ -344,9 +344,9 @@ rct_window* window_find_by_number(WindowClass cls, rct_windownumber number) } // TODO: Use variant for this once the window framework is done. -rct_window* window_find_by_number(WindowClass cls, EntityId id) +rct_window* WindowFindByNumber(WindowClass cls, EntityId id) { - return window_find_by_number(cls, static_cast(id.ToUnderlying())); + return WindowFindByNumber(cls, static_cast(id.ToUnderlying())); } /** @@ -354,9 +354,9 @@ rct_window* window_find_by_number(WindowClass cls, EntityId id) * * rct2: 0x006E403C */ -void window_close_top() +void WindowCloseTop() { - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { @@ -373,15 +373,15 @@ void window_close_top() * * rct2: 0x006EE927 */ -void window_close_all() +void WindowCloseAll() { - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); window_close_by_condition([](rct_window* w) -> bool { return !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); }); } -void window_close_all_except_class(WindowClass cls) +void WindowCloseAllExceptClass(WindowClass cls) { - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); window_close_by_condition([cls](rct_window* w) -> bool { return w->classification != cls && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); @@ -391,7 +391,7 @@ void window_close_all_except_class(WindowClass cls) /** * Closes all windows, save for those having any of the passed flags. */ -void window_close_all_except_flags(uint16_t flags) +void WindowCloseAllExceptFlags(uint16_t flags) { window_close_by_condition([flags](rct_window* w) -> bool { return !(w->flags & flags); }); } @@ -401,9 +401,9 @@ void window_close_all_except_flags(uint16_t flags) * @param number (dx) * @param cls (cl) without bit 15 set */ -void window_close_all_except_number_and_class(rct_windownumber number, WindowClass cls) +void WindowCloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls) { - window_close_by_class(WindowClass::Dropdown); + WindowCloseByClass(WindowClass::Dropdown); window_close_by_condition([cls, number](rct_window* w) -> bool { return (!(w->number == number && w->classification == cls) && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))); }); @@ -413,7 +413,7 @@ void window_close_all_except_number_and_class(rct_windownumber number, WindowCla * * rct2: 0x006EA845 */ -rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords) +rct_window* WindowFindFromPoint(const ScreenCoordsXY& screenCoords) { for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) { @@ -424,7 +424,7 @@ rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords) if (w->flags & WF_NO_BACKGROUND) { - auto widgetIndex = window_find_widget_from_point(*w.get(), screenCoords); + auto widgetIndex = WindowFindWidgetFromPoint(*w.get(), screenCoords); if (widgetIndex == -1) continue; } @@ -443,10 +443,10 @@ rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords) * returns widget_index (edx) * EDI NEEDS TO BE SET TO w->widgets[widget_index] AFTER */ -WidgetIndex window_find_widget_from_point(rct_window& w, const ScreenCoordsXY& screenCoords) +WidgetIndex WindowFindWidgetFromPoint(rct_window& w, const ScreenCoordsXY& screenCoords) { // Invalidate the window - window_event_invalidate_call(&w); + WindowEventInvalidateCall(&w); // Find the widget at point x, y WidgetIndex widget_index = -1; @@ -488,7 +488,7 @@ WidgetIndex window_find_widget_from_point(rct_window& w, const ScreenCoordsXY& s */ template static void window_invalidate_by_condition(TPred pred) { - window_visit_each([pred](rct_window* w) { + WindowVisitEach([pred](rct_window* w) { if (pred(w)) { w->Invalidate(); @@ -501,7 +501,7 @@ template static void window_invalidate_by_condition(TPred pred) * rct2: 0x006EC3AC * @param cls (al) with bit 14 set */ -void window_invalidate_by_class(WindowClass cls) +void WindowInvalidateByClass(WindowClass cls) { window_invalidate_by_condition([cls](rct_window* w) -> bool { return w->classification == cls; }); } @@ -510,31 +510,31 @@ void window_invalidate_by_class(WindowClass cls) * Invalidates all windows with the specified window class and number. * rct2: 0x006EC3AC */ -void window_invalidate_by_number(WindowClass cls, rct_windownumber number) +void WindowInvalidateByNumber(WindowClass cls, rct_windownumber number) { window_invalidate_by_condition( [cls, number](rct_window* w) -> bool { return w->classification == cls && w->number == number; }); } // TODO: Use variant for this once the window framework is done. -void window_invalidate_by_number(WindowClass cls, EntityId id) +void WindowInvalidateByNumber(WindowClass cls, EntityId id) { - window_invalidate_by_number(cls, static_cast(id.ToUnderlying())); + WindowInvalidateByNumber(cls, static_cast(id.ToUnderlying())); } /** * Invalidates all windows. */ -void window_invalidate_all() +void WindowInvalidateAll() { - window_visit_each([](rct_window* w) { w->Invalidate(); }); + WindowVisitEach([](rct_window* w) { w->Invalidate(); }); } /** * Invalidates the specified widget of a window. * rct2: 0x006EC402 */ -void widget_invalidate(rct_window& w, WidgetIndex widgetIndex) +void WidgetInvalidate(rct_window& w, WidgetIndex widgetIndex) { #ifdef DEBUG for (int32_t i = 0; i <= widgetIndex; i++) @@ -553,7 +553,7 @@ void widget_invalidate(rct_window& w, WidgetIndex widgetIndex) template static void widget_invalidate_by_condition(TPred pred) { - window_visit_each([pred](rct_window* w) { + WindowVisitEach([pred](rct_window* w) { if (pred(w)) { w->Invalidate(); @@ -564,12 +564,12 @@ template static void widget_invalidate_by_condition(TPred pred) /** * Invalidates the specified widget of all windows that match the specified window class. */ -void widget_invalidate_by_class(WindowClass cls, WidgetIndex widgetIndex) +void WidgetInvalidateByClass(WindowClass cls, WidgetIndex widgetIndex) { - window_visit_each([cls, widgetIndex](rct_window* w) { + WindowVisitEach([cls, widgetIndex](rct_window* w) { if (w->classification == cls) { - widget_invalidate(*w, widgetIndex); + WidgetInvalidate(*w, widgetIndex); } }); } @@ -578,12 +578,12 @@ void widget_invalidate_by_class(WindowClass cls, WidgetIndex widgetIndex) * Invalidates the specified widget of all windows that match the specified window class and number. * rct2: 0x006EC3AC */ -void widget_invalidate_by_number(WindowClass cls, rct_windownumber number, WidgetIndex widgetIndex) +void WidgetInvalidateByNumber(WindowClass cls, rct_windownumber number, WidgetIndex widgetIndex) { - window_visit_each([cls, number, widgetIndex](rct_window* w) { + WindowVisitEach([cls, number, widgetIndex](rct_window* w) { if (w->classification == cls && w->number == number) { - widget_invalidate(*w, widgetIndex); + WidgetInvalidate(*w, widgetIndex); } }); } @@ -594,7 +594,7 @@ void widget_invalidate_by_number(WindowClass cls, rct_windownumber number, Widge * * @param w The window (esi). */ -void window_update_scroll_widgets(rct_window& w) +void WindowUpdateScrollWidgets(rct_window& w) { int32_t scrollIndex, width, height, scrollPositionChanged; WidgetIndex widgetIndex; @@ -610,7 +610,7 @@ void window_update_scroll_widgets(rct_window& w) auto& scroll = w.scrolls[scrollIndex]; width = 0; height = 0; - window_get_scroll_size(&w, scrollIndex, &width, &height); + WindowGetScrollSize(&w, scrollIndex, &width, &height); if (height == 0) { scroll.v_top = 0; @@ -644,7 +644,7 @@ void window_update_scroll_widgets(rct_window& w) } } -int32_t window_get_scroll_data_index(const rct_window& w, WidgetIndex widget_index) +int32_t WindowGetScrollDataIndex(const rct_window& w, WidgetIndex widget_index) { int32_t i, result; @@ -662,11 +662,11 @@ int32_t window_get_scroll_data_index(const rct_window& w, WidgetIndex widget_ind * * rct2: 0x006ECDA4 */ -rct_window* window_bring_to_front(rct_window& w) +rct_window* WindowBringToFront(rct_window& w) { if (!(w.flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) { - auto itSourcePos = window_get_iterator(&w); + auto itSourcePos = WindowGetIterator(&w); if (itSourcePos != g_window_list.end()) { // Insert in front of the first non-stick-to-front window @@ -697,22 +697,22 @@ rct_window* window_bring_to_front(rct_window& w) return &w; } -rct_window* window_bring_to_front_by_class_with_flags(WindowClass cls, uint16_t flags) +rct_window* WindowBringToFrontByClassWithFlags(WindowClass cls, uint16_t flags) { - rct_window* w = window_find_by_class(cls); + rct_window* w = WindowFindByClass(cls); if (w != nullptr) { w->flags |= flags; w->Invalidate(); - w = window_bring_to_front(*w); + w = WindowBringToFront(*w); } return w; } -rct_window* window_bring_to_front_by_class(WindowClass cls) +rct_window* WindowBringToFrontByClass(WindowClass cls) { - return window_bring_to_front_by_class_with_flags(cls, WF_WHITE_BORDER_MASK); + return WindowBringToFrontByClassWithFlags(cls, WF_WHITE_BORDER_MASK); } /** @@ -721,16 +721,16 @@ rct_window* window_bring_to_front_by_class(WindowClass cls) * cls (cl) * number (dx) */ -rct_window* window_bring_to_front_by_number(WindowClass cls, rct_windownumber number) +rct_window* WindowBringToFrontByNumber(WindowClass cls, rct_windownumber number) { rct_window* w; - w = window_find_by_number(cls, number); + w = WindowFindByNumber(cls, number); if (w != nullptr) { w->flags |= WF_WHITE_BORDER_MASK; w->Invalidate(); - w = window_bring_to_front(*w); + w = WindowBringToFront(*w); } return w; @@ -740,9 +740,9 @@ rct_window* window_bring_to_front_by_number(WindowClass cls, rct_windownumber nu * * rct2: 0x006EE65A */ -void window_push_others_right(rct_window& window) +void WindowPushOthersRight(rct_window& window) { - window_visit_each([&window](rct_window* w) { + WindowVisitEach([&window](rct_window* w) { if (w == &window) return; if (w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)) @@ -771,10 +771,10 @@ void window_push_others_right(rct_window& window) * * rct2: 0x006EE6EA */ -void window_push_others_below(rct_window& w1) +void WindowPushOthersBelow(rct_window& w1) { // Enumerate through all other windows - window_visit_each([&w1](rct_window* w2) { + WindowVisitEach([&w1](rct_window* w2) { if (&w1 == w2) return; // ? @@ -809,7 +809,7 @@ void window_push_others_below(rct_window& w1) * * rct2: 0x006EE2E4 */ -rct_window* window_get_main() +rct_window* WindowGetMain() { for (auto& w : g_window_list) { @@ -829,9 +829,9 @@ rct_window* window_get_main() * @param y (ecx) * @param z (edx) */ -void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords) +void WindowScrollToLocation(rct_window& w, const CoordsXYZ& coords) { - window_unfollow_sprite(w); + WindowUnfollowSprite(w); if (w.viewport != nullptr) { int16_t height = TileElementHeight(coords); @@ -863,7 +863,7 @@ void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords) auto x2 = w.viewport->pos.x + static_cast(w.viewport->width * window_scroll_locations[i][0]); auto y2 = w.viewport->pos.y + static_cast(w.viewport->height * window_scroll_locations[i][1]); - auto it = window_get_iterator(&w); + auto it = WindowGetIterator(&w); for (; it != g_window_list.end(); it++) { auto w2 = (*it).get(); @@ -911,7 +911,7 @@ void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords) */ static void call_event_viewport_rotate_on_all_windows() { - window_visit_each([](rct_window* w) { window_event_viewport_rotate_call(w); }); + WindowVisitEach([](rct_window* w) { WindowEventViewportRotateCall(w); }); } /** @@ -921,7 +921,7 @@ static void call_event_viewport_rotate_on_all_windows() * 1: clockwise * -1: anti-clockwise */ -void window_rotate_camera(rct_window& w, int32_t direction) +void WindowRotateCamera(rct_window& w, int32_t direction) { rct_viewport* viewport = w.viewport; if (viewport == nullptr) @@ -965,7 +965,7 @@ void window_rotate_camera(rct_window& w, int32_t direction) reset_all_sprite_quadrant_placements(); } -void window_viewport_get_map_coords_by_cursor( +void WindowViewportGetMapCoordsByCursor( const rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y) { // Get mouse position to offset against. @@ -997,7 +997,7 @@ void window_viewport_get_map_coords_by_cursor( *offset_y = w.viewport->zoom.ApplyTo(w.savedViewPos.y - (centreLoc->y + rebased_y)); } -void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y) +void WindowViewportCentreTileAroundCursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y) { // Get viewport coordinates centring around the tile. int32_t z = TileElementHeight({ map_x, map_y }); @@ -1024,17 +1024,17 @@ void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int /** * For all windows with viewports, ensure they do not have a zoom level less than the minimum. */ -void window_check_all_valid_zoom() +void WindowCheckAllValidZoom() { - window_visit_each([](rct_window* w) { + WindowVisitEach([](rct_window* w) { if (w->viewport != nullptr && w->viewport->zoom < ZoomLevel::min()) { - window_zoom_set(*w, ZoomLevel::min(), false); + WindowZoomSet(*w, ZoomLevel::min(), false); } }); } -void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) +void WindowZoomSet(rct_window& w, ZoomLevel zoomLevel, bool atCursor) { rct_viewport* v = w.viewport; if (v == nullptr) @@ -1051,7 +1051,7 @@ void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) int32_t offset_y = 0; if (gConfigGeneral.ZoomToCursor && atCursor) { - window_viewport_get_map_coords_by_cursor(w, &saved_map_x, &saved_map_y, &offset_x, &offset_y); + WindowViewportGetMapCoordsByCursor(w, &saved_map_x, &saved_map_y, &offset_x, &offset_y); } // Zoom in @@ -1077,12 +1077,12 @@ void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) // Zooming to cursor? Centre around the tile we were hovering over just now. if (gConfigGeneral.ZoomToCursor && atCursor) { - window_viewport_centre_tile_around_cursor(w, saved_map_x, saved_map_y, offset_x, offset_y); + WindowViewportCentreTileAroundCursor(w, saved_map_x, saved_map_y, offset_x, offset_y); } // HACK: Prevents the redraw from failing when there is // a window on top of the viewport. - window_bring_to_front(w); + WindowBringToFront(w); w.Invalidate(); } @@ -1090,23 +1090,23 @@ void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) * * rct2: 0x006887A6 */ -void window_zoom_in(rct_window& w, bool atCursor) +void WindowZoomIn(rct_window& w, bool atCursor) { - window_zoom_set(w, w.viewport->zoom - 1, atCursor); + WindowZoomSet(w, w.viewport->zoom - 1, atCursor); } /** * * rct2: 0x006887E0 */ -void window_zoom_out(rct_window& w, bool atCursor) +void WindowZoomOut(rct_window& w, bool atCursor) { - window_zoom_set(w, w.viewport->zoom + 1, atCursor); + WindowZoomSet(w, w.viewport->zoom + 1, atCursor); } -void main_window_zoom(bool zoomIn, bool atCursor) +void MainWindowZoom(bool zoomIn, bool atCursor) { - auto* mainWindow = window_get_main(); + auto* mainWindow = WindowGetMain(); if (mainWindow == nullptr) return; @@ -1120,22 +1120,22 @@ void main_window_zoom(bool zoomIn, bool atCursor) return; if (zoomIn) - window_zoom_in(*mainWindow, atCursor); + WindowZoomIn(*mainWindow, atCursor); else - window_zoom_out(*mainWindow, atCursor); + WindowZoomOut(*mainWindow, atCursor); } /** * Splits a drawing of a window into regions that can be seen and are not hidden * by other opaque overlapping windows. */ -void window_draw(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom) +void WindowDraw(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom) { - if (!window_is_visible(w)) + if (!WindowIsVisible(w)) return; // Divide the draws up for only the visible regions of the window recursively - auto itPos = window_get_iterator(&w); + auto itPos = WindowGetIterator(&w); for (auto it = std::next(itPos); it != g_window_list.end(); it++) { // Check if this window overlaps w @@ -1197,10 +1197,10 @@ static void window_draw_core(rct_drawpixelinfo* dpi, rct_window& w, int32_t left return; // Draw the window and any other overlapping transparent windows - for (auto it = window_get_iterator(&w); it != g_window_list.end(); it++) + for (auto it = WindowGetIterator(&w); it != g_window_list.end(); it++) { auto* v = (*it).get(); - if ((&w == v || (v->flags & WF_TRANSPARENT)) && window_is_visible(*v)) + if ((&w == v || (v->flags & WF_TRANSPARENT)) && WindowIsVisible(*v)) { window_draw_single(dpi, *v, left, top, right, bottom); } @@ -1257,7 +1257,7 @@ static void window_draw_single(rct_drawpixelinfo* dpi, rct_window& w, int32_t le // Invalidate modifies the window colours so first get the correct // colour before setting the global variables for the string painting - window_event_invalidate_call(&w); + WindowEventInvalidateCall(&w); // Text colouring gCurrentWindowColours[0] = NOT_TRANSLUCENT(w.colours[0]); @@ -1265,7 +1265,7 @@ static void window_draw_single(rct_drawpixelinfo* dpi, rct_window& w, int32_t le gCurrentWindowColours[2] = NOT_TRANSLUCENT(w.colours[2]); gCurrentWindowColours[3] = NOT_TRANSLUCENT(w.colours[3]); - window_event_paint_call(&w, dpi); + WindowEventPaintCall(&w, dpi); } /** @@ -1275,17 +1275,17 @@ static void window_draw_single(rct_drawpixelinfo* dpi, rct_window& w, int32_t le * @param dpi (edi) * @param w (esi) */ -void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window& w) +void WindowDrawViewport(rct_drawpixelinfo* dpi, rct_window& w) { viewport_render(dpi, w.viewport, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }); } -void window_set_position(rct_window& w, const ScreenCoordsXY& screenCoords) +void WindowSetPosition(rct_window& w, const ScreenCoordsXY& screenCoords) { - window_move_position(w, screenCoords - w.windowPos); + WindowMovePosition(w, screenCoords - w.windowPos); } -void window_move_position(rct_window& w, const ScreenCoordsXY& deltaCoords) +void WindowMovePosition(rct_window& w, const ScreenCoordsXY& deltaCoords) { if (deltaCoords.x == 0 && deltaCoords.y == 0) return; @@ -1304,7 +1304,7 @@ void window_move_position(rct_window& w, const ScreenCoordsXY& deltaCoords) w.Invalidate(); } -void window_resize(rct_window& w, int32_t dw, int32_t dh) +void WindowResize(rct_window& w, int32_t dw, int32_t dh) { if (dw == 0 && dh == 0) return; @@ -1316,8 +1316,8 @@ void window_resize(rct_window& w, int32_t dw, int32_t dh) w.width = std::clamp(w.width + dw, w.min_width, w.max_width); w.height = std::clamp(w.height + dh, w.min_height, w.max_height); - window_event_resize_call(&w); - window_event_invalidate_call(&w); + WindowEventResizeCall(&w); + WindowEventInvalidateCall(&w); // Update scroll widgets for (auto& scroll : w.scrolls) @@ -1325,13 +1325,13 @@ void window_resize(rct_window& w, int32_t dw, int32_t dh) scroll.h_right = WINDOW_SCROLL_UNDEFINED; scroll.v_bottom = WINDOW_SCROLL_UNDEFINED; } - window_update_scroll_widgets(w); + WindowUpdateScrollWidgets(w); // Invalidate new region w.Invalidate(); } -void window_set_resize(rct_window& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight) +void WindowSetResize(rct_window& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight) { w.min_width = minWidth; w.min_height = minHeight; @@ -1360,18 +1360,18 @@ void window_set_resize(rct_window& w, int32_t minWidth, int32_t minHeight, int32 * @param widgetIndex (dx) * @param w (esi) */ -bool tool_set(const rct_window& w, WidgetIndex widgetIndex, Tool tool) +bool ToolSet(const rct_window& w, WidgetIndex widgetIndex, Tool tool) { if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { if (w.classification == gCurrentToolWidget.window_classification && w.number == gCurrentToolWidget.window_number && widgetIndex == gCurrentToolWidget.widget_index) { - tool_cancel(); + ToolCancel(); return true; } - tool_cancel(); + ToolCancel(); } input_set_flag(INPUT_FLAG_TOOL_ACTIVE, true); @@ -1388,7 +1388,7 @@ bool tool_set(const rct_window& w, WidgetIndex widgetIndex, Tool tool) * * rct2: 0x006EE281 */ -void tool_cancel() +void ToolCancel() { if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) { @@ -1403,18 +1403,18 @@ void tool_cancel() if (gCurrentToolWidget.widget_index != -1) { // Invalidate tool widget - widget_invalidate_by_number( + WidgetInvalidateByNumber( gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number, gCurrentToolWidget.widget_index); // Abort tool event - rct_window* w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + rct_window* w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) - window_event_tool_abort_call(w, gCurrentToolWidget.widget_index); + WindowEventToolAbortCall(w, gCurrentToolWidget.widget_index); } } } -void window_event_close_call(rct_window* w) +void WindowEventCloseCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnClose(); @@ -1422,7 +1422,7 @@ void window_event_close_call(rct_window* w) w->event_handlers->close(w); } -void window_event_mouse_up_call(rct_window* w, WidgetIndex widgetIndex) +void WindowEventMouseUpCall(rct_window* w, WidgetIndex widgetIndex) { if (w->event_handlers == nullptr) w->OnMouseUp(widgetIndex); @@ -1430,7 +1430,7 @@ void window_event_mouse_up_call(rct_window* w, WidgetIndex widgetIndex) w->event_handlers->mouse_up(w, widgetIndex); } -void window_event_resize_call(rct_window* w) +void WindowEventResizeCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnResize(); @@ -1438,7 +1438,7 @@ void window_event_resize_call(rct_window* w) w->event_handlers->resize(w); } -void window_event_mouse_down_call(rct_window* w, WidgetIndex widgetIndex) +void WindowEventMouseDownCall(rct_window* w, WidgetIndex widgetIndex) { if (w->event_handlers == nullptr) w->OnMouseDown(widgetIndex); @@ -1446,7 +1446,7 @@ void window_event_mouse_down_call(rct_window* w, WidgetIndex widgetIndex) w->event_handlers->mouse_down(w, widgetIndex, &w->widgets[widgetIndex]); } -void window_event_dropdown_call(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex) +void WindowEventDropdownCall(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex) { if (w->event_handlers == nullptr) { @@ -1461,7 +1461,7 @@ void window_event_dropdown_call(rct_window* w, WidgetIndex widgetIndex, int32_t } } -void window_event_unknown_05_call(rct_window* w) +void WindowEventUnknown05Call(rct_window* w) { if (w->event_handlers == nullptr) { @@ -1473,7 +1473,7 @@ void window_event_unknown_05_call(rct_window* w) } } -void window_event_update_call(rct_window* w) +void WindowEventUpdateCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnUpdate(); @@ -1481,7 +1481,7 @@ void window_event_update_call(rct_window* w) w->event_handlers->update(w); } -void window_event_periodic_update_call(rct_window* w) +void WindowEventPeriodicUpdateCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnPeriodicUpdate(); @@ -1489,7 +1489,7 @@ void window_event_periodic_update_call(rct_window* w) w->event_handlers->periodic_update(w); } -void window_event_tool_update_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) +void WindowEventToolUpdateCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnToolUpdate(widgetIndex, screenCoords); @@ -1497,7 +1497,7 @@ void window_event_tool_update_call(rct_window* w, WidgetIndex widgetIndex, const w->event_handlers->tool_update(w, widgetIndex, screenCoords); } -void window_event_tool_down_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) +void WindowEventToolDownCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnToolDown(widgetIndex, screenCoords); @@ -1505,7 +1505,7 @@ void window_event_tool_down_call(rct_window* w, WidgetIndex widgetIndex, const S w->event_handlers->tool_down(w, widgetIndex, screenCoords); } -void window_event_tool_drag_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) +void WindowEventToolDragCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnToolDrag(widgetIndex, screenCoords); @@ -1513,7 +1513,7 @@ void window_event_tool_drag_call(rct_window* w, WidgetIndex widgetIndex, const S w->event_handlers->tool_drag(w, widgetIndex, screenCoords); } -void window_event_tool_up_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) +void WindowEventToolUpCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnToolUp(widgetIndex, screenCoords); @@ -1521,7 +1521,7 @@ void window_event_tool_up_call(rct_window* w, WidgetIndex widgetIndex, const Scr w->event_handlers->tool_up(w, widgetIndex, screenCoords); } -void window_event_tool_abort_call(rct_window* w, WidgetIndex widgetIndex) +void WindowEventToolAbortCall(rct_window* w, WidgetIndex widgetIndex) { if (w->event_handlers == nullptr) w->OnToolAbort(widgetIndex); @@ -1529,7 +1529,7 @@ void window_event_tool_abort_call(rct_window* w, WidgetIndex widgetIndex) w->event_handlers->tool_abort(w, widgetIndex); } -void window_get_scroll_size(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) +void WindowGetScrollSize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) { if (w->event_handlers == nullptr) { @@ -1545,7 +1545,7 @@ void window_get_scroll_size(rct_window* w, int32_t scrollIndex, int32_t* width, } } -void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) +void WindowEventScrollMousedownCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnScrollMouseDown(scrollIndex, screenCoords); @@ -1553,7 +1553,7 @@ void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, cons w->event_handlers->scroll_mousedown(w, scrollIndex, screenCoords); } -void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) +void WindowEventScrollMousedragCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnScrollMouseDrag(scrollIndex, screenCoords); @@ -1561,7 +1561,7 @@ void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, cons w->event_handlers->scroll_mousedrag(w, scrollIndex, screenCoords); } -void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) +void WindowEventScrollMouseoverCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) w->OnScrollMouseOver(scrollIndex, screenCoords); @@ -1569,7 +1569,7 @@ void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, cons w->event_handlers->scroll_mouseover(w, scrollIndex, screenCoords); } -void window_event_textinput_call(rct_window* w, WidgetIndex widgetIndex, char* text) +void WindowEventTextinputCall(rct_window* w, WidgetIndex widgetIndex, char* text) { if (w->event_handlers == nullptr) { @@ -1584,7 +1584,7 @@ void window_event_textinput_call(rct_window* w, WidgetIndex widgetIndex, char* t } } -void window_event_viewport_rotate_call(rct_window* w) +void WindowEventViewportRotateCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnViewportRotate(); @@ -1593,7 +1593,7 @@ void window_event_viewport_rotate_call(rct_window* w) w->event_handlers->viewport_rotate(w); } -void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) +void WindowEventScrollSelectCall(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) { if (w->event_handlers == nullptr) w->OnScrollSelect(scrollIndex, scrollAreaType); @@ -1601,7 +1601,7 @@ void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t w->event_handlers->scroll_select(w, scrollIndex, scrollAreaType); } -OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback) +OpenRCT2String WindowEventTooltipCall(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback) { if (w->event_handlers == nullptr) { @@ -1616,7 +1616,7 @@ OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widget return { fallback, {} }; } -CursorID window_event_cursor_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) +CursorID WindowEventCursorCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { CursorID cursorId = CursorID::Arrow; if (w->event_handlers == nullptr) @@ -1628,7 +1628,7 @@ CursorID window_event_cursor_call(rct_window* w, WidgetIndex widgetIndex, const return cursorId; } -void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords) +void WindowEventMovedCall(rct_window* w, const ScreenCoordsXY& screenCoords) { if (w->event_handlers == nullptr) { @@ -1638,7 +1638,7 @@ void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords) w->event_handlers->moved(w, screenCoords); } -void window_event_invalidate_call(rct_window* w) +void WindowEventInvalidateCall(rct_window* w) { if (w->event_handlers == nullptr) w->OnPrepareDraw(); @@ -1646,7 +1646,7 @@ void window_event_invalidate_call(rct_window* w) w->event_handlers->invalidate(w); } -void window_event_paint_call(rct_window* w, rct_drawpixelinfo* dpi) +void WindowEventPaintCall(rct_window* w, rct_drawpixelinfo* dpi) { if (w->event_handlers == nullptr) w->OnDraw(*dpi); @@ -1654,7 +1654,7 @@ void window_event_paint_call(rct_window* w, rct_drawpixelinfo* dpi) w->event_handlers->paint(w, dpi); } -void window_event_scroll_paint_call(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) +void WindowEventScrollPaintCall(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { if (w->event_handlers == nullptr) w->OnScrollDraw(scrollIndex, *dpi); @@ -1668,10 +1668,10 @@ void window_event_scroll_paint_call(rct_window* w, rct_drawpixelinfo* dpi, int32 * Called after a window resize to move windows if they * are going to be out of sight. */ -void window_relocate_windows(int32_t width, int32_t height) +void WindowRelocateWindows(int32_t width, int32_t height) { int32_t new_location = 8; - window_visit_each([width, height, &new_location](rct_window* w) { + WindowVisitEach([width, height, &new_location](rct_window* w) { // Work out if the window requires moving if (w->windowPos.x + 10 < width) { @@ -1706,27 +1706,27 @@ void window_relocate_windows(int32_t width, int32_t height) /** * rct2: 0x0066B905 */ -void window_resize_gui(int32_t width, int32_t height) +void WindowResizeGui(int32_t width, int32_t height) { - window_resize_gui_scenario_editor(width, height); + WindowResizeGuiScenarioEditor(width, height); if (gScreenFlags & SCREEN_FLAGS_EDITOR) return; - rct_window* titleWind = window_find_by_class(WindowClass::TitleMenu); + rct_window* titleWind = WindowFindByClass(WindowClass::TitleMenu); if (titleWind != nullptr) { titleWind->windowPos.x = (width - titleWind->width) / 2; titleWind->windowPos.y = height - 182; } - rct_window* exitWind = window_find_by_class(WindowClass::TitleExit); + rct_window* exitWind = WindowFindByClass(WindowClass::TitleExit); if (exitWind != nullptr) { exitWind->windowPos.x = width - 40; exitWind->windowPos.y = height - 64; } - rct_window* optionsWind = window_find_by_class(WindowClass::TitleOptions); + rct_window* optionsWind = WindowFindByClass(WindowClass::TitleOptions); if (optionsWind != nullptr) { optionsWind->windowPos.x = width - 80; @@ -1738,9 +1738,9 @@ void window_resize_gui(int32_t width, int32_t height) /** * rct2: 0x0066F0DD */ -void window_resize_gui_scenario_editor(int32_t width, int32_t height) +void WindowResizeGuiScenarioEditor(int32_t width, int32_t height) { - auto* mainWind = window_get_main(); + auto* mainWind = WindowGetMain(); if (mainWind != nullptr) { rct_viewport* viewport = mainWind->viewport; @@ -1757,13 +1757,13 @@ void window_resize_gui_scenario_editor(int32_t width, int32_t height) } } - rct_window* topWind = window_find_by_class(WindowClass::TopToolbar); + rct_window* topWind = WindowFindByClass(WindowClass::TopToolbar); if (topWind != nullptr) { topWind->width = std::max(640, width); } - rct_window* bottomWind = window_find_by_class(WindowClass::BottomToolbar); + rct_window* bottomWind = WindowFindByClass(WindowClass::BottomToolbar); if (bottomWind != nullptr) { bottomWind->windowPos.y = height - 32; @@ -1775,19 +1775,19 @@ void window_resize_gui_scenario_editor(int32_t width, int32_t height) * * rct2: 0x006CBCC3 */ -void window_close_construction_windows() +void WindowCloseConstructionWindows() { - window_close_by_class(WindowClass::RideConstruction); - window_close_by_class(WindowClass::Footpath); - window_close_by_class(WindowClass::TrackDesignList); - window_close_by_class(WindowClass::TrackDesignPlace); + WindowCloseByClass(WindowClass::RideConstruction); + WindowCloseByClass(WindowClass::Footpath); + WindowCloseByClass(WindowClass::TrackDesignList); + WindowCloseByClass(WindowClass::TrackDesignPlace); } /** * Update zoom based volume attenuation for ride music and clear music list. * rct2: 0x006BC348 */ -void window_update_viewport_ride_music() +void WindowUpdateViewportRideMusic() { OpenRCT2::RideAudio::ClearAllViewportInstances(); g_music_tracking_viewport = nullptr; @@ -1814,13 +1814,13 @@ void window_update_viewport_ride_music() static void window_snap_left(rct_window& w, int32_t proximity) { - const auto* mainWindow = window_get_main(); + const auto* mainWindow = WindowGetMain(); auto wBottom = w.windowPos.y + w.height; auto wLeftProximity = w.windowPos.x - (proximity * 2); auto wRightProximity = w.windowPos.x + (proximity * 2); auto rightMost = INT32_MIN; - window_visit_each([&](rct_window* w2) { + WindowVisitEach([&](rct_window* w2) { if (w2 == &w || w2 == mainWindow) return; @@ -1844,13 +1844,13 @@ static void window_snap_left(rct_window& w, int32_t proximity) static void window_snap_top(rct_window& w, int32_t proximity) { - const auto* mainWindow = window_get_main(); + const auto* mainWindow = WindowGetMain(); auto wRight = w.windowPos.x + w.width; auto wTopProximity = w.windowPos.y - (proximity * 2); auto wBottomProximity = w.windowPos.y + (proximity * 2); auto bottomMost = INT32_MIN; - window_visit_each([&](rct_window* w2) { + WindowVisitEach([&](rct_window* w2) { if (w2 == &w || w2 == mainWindow) return; @@ -1874,14 +1874,14 @@ static void window_snap_top(rct_window& w, int32_t proximity) static void window_snap_right(rct_window& w, int32_t proximity) { - const auto* mainWindow = window_get_main(); + const auto* mainWindow = WindowGetMain(); auto wRight = w.windowPos.x + w.width; auto wBottom = w.windowPos.y + w.height; auto wLeftProximity = wRight - (proximity * 2); auto wRightProximity = wRight + (proximity * 2); auto leftMost = INT32_MAX; - window_visit_each([&](rct_window* w2) { + WindowVisitEach([&](rct_window* w2) { if (w2 == &w || w2 == mainWindow) return; @@ -1904,14 +1904,14 @@ static void window_snap_right(rct_window& w, int32_t proximity) static void window_snap_bottom(rct_window& w, int32_t proximity) { - const auto* mainWindow = window_get_main(); + const auto* mainWindow = WindowGetMain(); auto wRight = w.windowPos.x + w.width; auto wBottom = w.windowPos.y + w.height; auto wTopProximity = wBottom - (proximity * 2); auto wBottomProximity = wBottom + (proximity * 2); auto topMost = INT32_MAX; - window_visit_each([&](rct_window* w2) { + WindowVisitEach([&](rct_window* w2) { if (w2 == &w || w2 == mainWindow) return; @@ -1932,7 +1932,7 @@ static void window_snap_bottom(rct_window& w, int32_t proximity) w.windowPos.y = topMost - w.height; } -void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity) +void WindowMoveAndSnap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity) { auto originalPos = w.windowPos; int32_t minY = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 1 : TOP_TOOLBAR_HEIGHT + 2; @@ -1955,10 +1955,10 @@ void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t w.windowPos = originalPos; } - window_set_position(w, newWindowCoords); + WindowSetPosition(w, newWindowCoords); } -int32_t window_can_resize(const rct_window& w) +int32_t WindowCanResize(const rct_window& w) { return (w.flags & WF_RESIZABLE) && (w.min_width != w.max_width || w.min_height != w.max_height); } @@ -1967,16 +1967,16 @@ int32_t window_can_resize(const rct_window& w) * * rct2: 0x006EE3C3 */ -void textinput_cancel() +void TextinputCancel() { - window_close_by_class(WindowClass::Textinput); + WindowCloseByClass(WindowClass::Textinput); } -void window_start_textbox( +void WindowStartTextbox( rct_window& call_w, WidgetIndex call_widget, StringId existing_text, char* existing_args, int32_t maxLength) { if (gUsingWidgetTextBox) - window_cancel_textbox(); + WindowCancelTextbox(); gUsingWidgetTextBox = true; gCurrentTextBox.window.classification = call_w.classification; @@ -1984,7 +1984,7 @@ void window_start_textbox( gCurrentTextBox.widget_index = call_widget; gTextBoxFrameNo = 0; - window_close_by_class(WindowClass::Textinput); + WindowCloseByClass(WindowClass::Textinput); // Clear the text input buffer std::fill_n(gTextBoxInput, maxLength, 0x00); @@ -2001,14 +2001,14 @@ void window_start_textbox( gTextInput = ContextStartTextInput(gTextBoxInput, maxLength); } -void window_cancel_textbox() +void WindowCancelTextbox() { if (gUsingWidgetTextBox) { - rct_window* w = window_find_by_number(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); + rct_window* w = WindowFindByNumber(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); if (w != nullptr) { - window_event_textinput_call(w, gCurrentTextBox.widget_index, nullptr); + WindowEventTextinputCall(w, gCurrentTextBox.widget_index, nullptr); } gCurrentTextBox.window.classification = WindowClass::Null; gCurrentTextBox.window.number = 0; @@ -2016,31 +2016,31 @@ void window_cancel_textbox() gUsingWidgetTextBox = false; if (w != nullptr) { - widget_invalidate(*w, gCurrentTextBox.widget_index); + WidgetInvalidate(*w, gCurrentTextBox.widget_index); } gCurrentTextBox.widget_index = static_cast(WindowWidgetType::Last); } } -void window_update_textbox_caret() +void WindowUpdateTextboxCaret() { gTextBoxFrameNo++; if (gTextBoxFrameNo > 30) gTextBoxFrameNo = 0; } -void window_update_textbox() +void WindowUpdateTextbox() { if (gUsingWidgetTextBox) { gTextBoxFrameNo = 0; - rct_window* w = window_find_by_number(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); - widget_invalidate(*w, gCurrentTextBox.widget_index); - window_event_textinput_call(w, gCurrentTextBox.widget_index, gTextBoxInput); + rct_window* w = WindowFindByNumber(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); + WidgetInvalidate(*w, gCurrentTextBox.widget_index); + WindowEventTextinputCall(w, gCurrentTextBox.widget_index, gTextBoxInput); } } -bool window_is_visible(rct_window& w) +bool WindowIsVisible(rct_window& w) { // w->visibility is used to prevent repeat calculations within an iteration by caching the result @@ -2058,7 +2058,7 @@ bool window_is_visible(rct_window& w) } // start from the window above the current - auto itPos = window_get_iterator(&w); + auto itPos = WindowGetIterator(&w); for (auto it = std::next(itPos); it != g_window_list.end(); it++) { auto& w_other = *(*it); @@ -2088,21 +2088,21 @@ bool window_is_visible(rct_window& w) * right (dx) * bottom (bp) */ -void window_draw_all(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom) +void WindowDrawAll(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom) { auto windowDPI = dpi->Crop({ left, top }, { right - left, bottom - top }); - window_visit_each([&windowDPI, left, top, right, bottom](rct_window* w) { + WindowVisitEach([&windowDPI, left, top, right, bottom](rct_window* w) { if (w->flags & WF_TRANSPARENT) return; if (right <= w->windowPos.x || bottom <= w->windowPos.y) return; if (left >= w->windowPos.x + w->width || top >= w->windowPos.y + w->height) return; - window_draw(&windowDPI, *w, left, top, right, bottom); + WindowDraw(&windowDPI, *w, left, top, right, bottom); }); } -rct_viewport* window_get_previous_viewport(rct_viewport* current) +rct_viewport* WindowGetPreviousViewport(rct_viewport* current) { bool foundPrevious = (current == nullptr); for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) @@ -2123,10 +2123,10 @@ rct_viewport* window_get_previous_viewport(rct_viewport* current) return nullptr; } -void window_reset_visibilities() +void WindowResetVisibilities() { // reset window visibility status to unknown - window_visit_each([](rct_window* w) { + WindowVisitEach([](rct_window* w) { w->visibility = VisibilityCache::Unknown; if (w->viewport != nullptr) { @@ -2135,12 +2135,12 @@ void window_reset_visibilities() }); } -void window_init_all() +void WindowInitAll() { - window_close_all_except_flags(0); + WindowCloseAllExceptFlags(0); } -void window_follow_sprite(rct_window& w, EntityId spriteIndex) +void WindowFollowSprite(rct_window& w, EntityId spriteIndex) { if (spriteIndex.ToUnderlying() < MAX_ENTITIES || spriteIndex.IsNull()) { @@ -2148,13 +2148,13 @@ void window_follow_sprite(rct_window& w, EntityId spriteIndex) } } -void window_unfollow_sprite(rct_window& w) +void WindowUnfollowSprite(rct_window& w) { w.viewport_smart_follow_sprite = EntityId::GetNull(); w.viewport_target_sprite = EntityId::GetNull(); } -rct_viewport* window_get_viewport(rct_window* w) +rct_viewport* WindowGetViewport(rct_window* w) { if (w == nullptr) { @@ -2164,7 +2164,7 @@ rct_viewport* window_get_viewport(rct_window* w) return w->viewport; } -rct_window* window_get_listening() +rct_window* WindowGetListening() { for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) { @@ -2181,7 +2181,7 @@ rct_window* window_get_listening() return nullptr; } -WindowClass window_get_classification(const rct_window& window) +WindowClass WindowGetClassification(const rct_window& window) { return window.classification; } @@ -2193,7 +2193,7 @@ WindowClass window_get_classification(const rct_window& window) void WidgetScrollUpdateThumbs(rct_window& w, WidgetIndex widget_index) { const auto& widget = w.widgets[widget_index]; - auto& scroll = w.scrolls[window_get_scroll_data_index(w, widget_index)]; + auto& scroll = w.scrolls[WindowGetScrollDataIndex(w, widget_index)]; if (scroll.flags & HSCROLLBAR_VISIBLE) { diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index b9f04c1386..532e30137e 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -564,19 +564,19 @@ extern colour_t gCurrentWindowColours[4]; extern bool gDisableErrorWindowSound; -std::list>::iterator window_get_iterator(const rct_window* w); -void window_visit_each(std::function func); +std::list>::iterator WindowGetIterator(const rct_window* w); +void WindowVisitEach(std::function func); -void window_dispatch_update_all(); -void window_update_all_viewports(); -void window_update_all(); +void WindowDispatchUpdateAll(); +void WindowUpdateAllViewports(); +void WindowUpdateAll(); -void window_set_window_limit(int32_t value); +void WindowSetWindowLimit(int32_t value); -rct_window* window_bring_to_front(rct_window& w); -rct_window* window_bring_to_front_by_class(WindowClass cls); -rct_window* window_bring_to_front_by_class_with_flags(WindowClass cls, uint16_t flags); -rct_window* window_bring_to_front_by_number(WindowClass cls, rct_windownumber number); +rct_window* WindowBringToFront(rct_window& w); +rct_window* WindowBringToFrontByClass(WindowClass cls); +rct_window* WindowBringToFrontByClassWithFlags(WindowClass cls, uint16_t flags); +rct_window* WindowBringToFrontByNumber(WindowClass cls, rct_windownumber number); rct_window* WindowCreate( std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags); @@ -594,7 +594,7 @@ T* WindowCreate(WindowClass cls, int32_t width, int32_t height, uint32_t flags = template::value>::type* = nullptr> T* WindowFocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, int32_t width, int32_t height, uint32_t flags = 0) { - auto* w = window_bring_to_front_by_class(cls); + auto* w = WindowBringToFrontByClass(cls); if (w == nullptr) { w = WindowCreate(cls, pos, width, height, flags); @@ -604,7 +604,7 @@ T* WindowFocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, int32_t width template::value>::type* = nullptr> T* WindowFocusOrCreate(WindowClass cls, int32_t width, int32_t height, uint32_t flags = 0) { - auto* w = window_bring_to_front_by_class(cls); + auto* w = WindowBringToFrontByClass(cls); if (w == nullptr) { w = WindowCreate(cls, width, height, flags); @@ -619,152 +619,152 @@ rct_window* WindowCreateAutoPos( rct_window* WindowCreateCentred( int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags); -void window_close(rct_window& window); -void window_close_by_class(WindowClass cls); -void window_close_by_number(WindowClass cls, rct_windownumber number); -void window_close_by_number(WindowClass cls, EntityId number); -void window_close_top(); -void window_close_all(); -void window_close_all_except_class(WindowClass cls); -void window_close_all_except_flags(uint16_t flags); -void window_close_all_except_number_and_class(rct_windownumber number, WindowClass cls); -rct_window* window_find_by_class(WindowClass cls); -rct_window* window_find_by_number(WindowClass cls, rct_windownumber number); -rct_window* window_find_by_number(WindowClass cls, EntityId id); -rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords); -WidgetIndex window_find_widget_from_point(rct_window& w, const ScreenCoordsXY& screenCoords); -void window_invalidate_by_class(WindowClass cls); -void window_invalidate_by_number(WindowClass cls, rct_windownumber number); -void window_invalidate_by_number(WindowClass cls, EntityId id); -void window_invalidate_all(); -void widget_invalidate(rct_window& w, WidgetIndex widgetIndex); -void widget_invalidate_by_class(WindowClass cls, WidgetIndex widgetIndex); -void widget_invalidate_by_number(WindowClass cls, rct_windownumber number, WidgetIndex widgetIndex); +void WindowClose(rct_window& window); +void WindowCloseByClass(WindowClass cls); +void WindowCloseByNumber(WindowClass cls, rct_windownumber number); +void WindowCloseByNumber(WindowClass cls, EntityId number); +void WindowCloseTop(); +void WindowCloseAll(); +void WindowCloseAllExceptClass(WindowClass cls); +void WindowCloseAllExceptFlags(uint16_t flags); +void WindowCloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls); +rct_window* WindowFindByClass(WindowClass cls); +rct_window* WindowFindByNumber(WindowClass cls, rct_windownumber number); +rct_window* WindowFindByNumber(WindowClass cls, EntityId id); +rct_window* WindowFindFromPoint(const ScreenCoordsXY& screenCoords); +WidgetIndex WindowFindWidgetFromPoint(rct_window& w, const ScreenCoordsXY& screenCoords); +void WindowInvalidateByClass(WindowClass cls); +void WindowInvalidateByNumber(WindowClass cls, rct_windownumber number); +void WindowInvalidateByNumber(WindowClass cls, EntityId id); +void WindowInvalidateAll(); +void WidgetInvalidate(rct_window& w, WidgetIndex widgetIndex); +void WidgetInvalidateByClass(WindowClass cls, WidgetIndex widgetIndex); +void WidgetInvalidateByNumber(WindowClass cls, rct_windownumber number, WidgetIndex widgetIndex); void WindowInitScrollWidgets(rct_window& w); -void window_update_scroll_widgets(rct_window& w); -int32_t window_get_scroll_data_index(const rct_window& w, WidgetIndex widget_index); +void WindowUpdateScrollWidgets(rct_window& w); +int32_t WindowGetScrollDataIndex(const rct_window& w, WidgetIndex widget_index); -void window_push_others_right(rct_window& w); -void window_push_others_below(rct_window& w1); +void WindowPushOthersRight(rct_window& w); +void WindowPushOthersBelow(rct_window& w1); -rct_window* window_get_main(); +rct_window* WindowGetMain(); -void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords); -void window_rotate_camera(rct_window& w, int32_t direction); -void window_viewport_get_map_coords_by_cursor( +void WindowScrollToLocation(rct_window& w, const CoordsXYZ& coords); +void WindowRotateCamera(rct_window& w, int32_t direction); +void WindowViewportGetMapCoordsByCursor( const rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y); -void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y); -void window_check_all_valid_zoom(); -void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor); -void window_zoom_in(rct_window& w, bool atCursor); -void window_zoom_out(rct_window& w, bool atCursor); -void main_window_zoom(bool zoomIn, bool atCursor); +void WindowViewportCentreTileAroundCursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y); +void WindowCheckAllValidZoom(); +void WindowZoomSet(rct_window& w, ZoomLevel zoomLevel, bool atCursor); +void WindowZoomIn(rct_window& w, bool atCursor); +void WindowZoomOut(rct_window& w, bool atCursor); +void MainWindowZoom(bool zoomIn, bool atCursor); -void window_draw_all(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom); -void window_draw(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom); +void WindowDrawAll(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom); +void WindowDraw(rct_drawpixelinfo* dpi, rct_window& w, int32_t left, int32_t top, int32_t right, int32_t bottom); void WindowDrawWidgets(rct_window& w, rct_drawpixelinfo* dpi); -void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window& w); +void WindowDrawViewport(rct_drawpixelinfo* dpi, rct_window& w); -void window_set_position(rct_window& w, const ScreenCoordsXY& screenCoords); -void window_move_position(rct_window& w, const ScreenCoordsXY& screenCoords); -void window_resize(rct_window& w, int32_t dw, int32_t dh); -void window_set_resize(rct_window& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight); +void WindowSetPosition(rct_window& w, const ScreenCoordsXY& screenCoords); +void WindowMovePosition(rct_window& w, const ScreenCoordsXY& screenCoords); +void WindowResize(rct_window& w, int32_t dw, int32_t dh); +void WindowSetResize(rct_window& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight); -bool tool_set(const rct_window& w, WidgetIndex widgetIndex, Tool tool); -void tool_cancel(); +bool ToolSet(const rct_window& w, WidgetIndex widgetIndex, Tool tool); +void ToolCancel(); -void window_close_construction_windows(); +void WindowCloseConstructionWindows(); -void window_update_viewport_ride_music(); +void WindowUpdateViewportRideMusic(); -rct_viewport* window_get_viewport(rct_window* window); +rct_viewport* WindowGetViewport(rct_window* window); // Open window functions -void window_relocate_windows(int32_t width, int32_t height); -void window_resize_gui(int32_t width, int32_t height); -void window_resize_gui_scenario_editor(int32_t width, int32_t height); -void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords); -void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords); -void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords); +void WindowRelocateWindows(int32_t width, int32_t height); +void WindowResizeGui(int32_t width, int32_t height); +void WindowResizeGuiScenarioEditor(int32_t width, int32_t height); +void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); +void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); +void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); -void window_event_close_call(rct_window* w); -void window_event_mouse_up_call(rct_window* w, WidgetIndex widgetIndex); -void window_event_resize_call(rct_window* w); -void window_event_mouse_down_call(rct_window* w, WidgetIndex widgetIndex); -void window_event_dropdown_call(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex); -void window_event_unknown_05_call(rct_window* w); -void window_event_update_call(rct_window* w); -void window_event_periodic_update_call(rct_window* w); -void window_event_tool_update_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void window_event_tool_down_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void window_event_tool_drag_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void window_event_tool_up_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void window_event_tool_abort_call(rct_window* w, WidgetIndex widgetIndex); -void window_get_scroll_size(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); -void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void window_event_textinput_call(rct_window* w, WidgetIndex widgetIndex, char* text); -void window_event_viewport_rotate_call(rct_window* w); -void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); -OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback); -CursorID window_event_cursor_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords); -void window_event_invalidate_call(rct_window* w); -void window_event_paint_call(rct_window* w, rct_drawpixelinfo* dpi); -void window_event_scroll_paint_call(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); +void WindowEventCloseCall(rct_window* w); +void WindowEventMouseUpCall(rct_window* w, WidgetIndex widgetIndex); +void WindowEventResizeCall(rct_window* w); +void WindowEventMouseDownCall(rct_window* w, WidgetIndex widgetIndex); +void WindowEventDropdownCall(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex); +void WindowEventUnknown05Call(rct_window* w); +void WindowEventUpdateCall(rct_window* w); +void WindowEventPeriodicUpdateCall(rct_window* w); +void WindowEventToolUpdateCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void WindowEventToolDownCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void WindowEventToolDragCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void WindowEventToolUpCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void WindowEventToolAbortCall(rct_window* w, WidgetIndex widgetIndex); +void WindowGetScrollSize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +void WindowEventScrollMousedownCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +void WindowEventScrollMousedragCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +void WindowEventScrollMouseoverCall(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +void WindowEventTextinputCall(rct_window* w, WidgetIndex widgetIndex, char* text); +void WindowEventViewportRotateCall(rct_window* w); +void WindowEventScrollSelectCall(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); +OpenRCT2String WindowEventTooltipCall(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback); +CursorID WindowEventCursorCall(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); +void WindowEventMovedCall(rct_window* w, const ScreenCoordsXY& screenCoords); +void WindowEventInvalidateCall(rct_window* w); +void WindowEventPaintCall(rct_window* w, rct_drawpixelinfo* dpi); +void WindowEventScrollPaintCall(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); void InvalidateAllWindowsAfterInput(); -void textinput_cancel(); +void TextinputCancel(); -void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity); -int32_t window_can_resize(const rct_window& w); +void WindowMoveAndSnap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity); +int32_t WindowCanResize(const rct_window& w); -void window_start_textbox( +void WindowStartTextbox( rct_window& call_w, WidgetIndex call_widget, StringId existing_text, char* existing_args, int32_t maxLength); -void window_cancel_textbox(); -void window_update_textbox_caret(); -void window_update_textbox(); +void WindowCancelTextbox(); +void WindowUpdateTextboxCaret(); +void WindowUpdateTextbox(); -bool window_is_visible(rct_window& w); +bool WindowIsVisible(rct_window& w); -bool scenery_tool_is_active(); +bool SceneryToolIsActive(); -rct_viewport* window_get_previous_viewport(rct_viewport* current); -void window_reset_visibilities(); -void window_init_all(); +rct_viewport* WindowGetPreviousViewport(rct_viewport* current); +void WindowResetVisibilities(); +void WindowInitAll(); -void window_ride_construction_keyboard_shortcut_turn_left(); -void window_ride_construction_keyboard_shortcut_turn_right(); -void window_ride_construction_keyboard_shortcut_use_track_default(); -void window_ride_construction_keyboard_shortcut_slope_down(); -void window_ride_construction_keyboard_shortcut_slope_up(); -void window_ride_construction_keyboard_shortcut_chain_lift_toggle(); -void window_ride_construction_keyboard_shortcut_bank_left(); -void window_ride_construction_keyboard_shortcut_bank_right(); -void window_ride_construction_keyboard_shortcut_previous_track(); -void window_ride_construction_keyboard_shortcut_next_track(); -void window_ride_construction_keyboard_shortcut_build_current(); -void window_ride_construction_keyboard_shortcut_demolish_current(); +void WindowRideConstructionKeyboardShortcutTurnLeft(); +void WindowRideConstructionKeyboardShortcutTurnRight(); +void WindowRideConstructionKeyboardShortcutUseTrackDefault(); +void WindowRideConstructionKeyboardShortcutSlopeDown(); +void WindowRideConstructionKeyboardShortcutSlopeUp(); +void WindowRideConstructionKeyboardShortcutChainLiftToggle(); +void WindowRideConstructionKeyboardShortcutBankLeft(); +void WindowRideConstructionKeyboardShortcutBankRight(); +void WindowRideConstructionKeyboardShortcutPreviousTrack(); +void WindowRideConstructionKeyboardShortcutNextTrack(); +void WindowRideConstructionKeyboardShortcutBuildCurrent(); +void WindowRideConstructionKeyboardShortcutDemolishCurrent(); -void window_footpath_keyboard_shortcut_turn_left(); -void window_footpath_keyboard_shortcut_turn_right(); -void window_footpath_keyboard_shortcut_slope_down(); -void window_footpath_keyboard_shortcut_slope_up(); -void window_footpath_keyboard_shortcut_build_current(); -void window_footpath_keyboard_shortcut_demolish_current(); +void WindowFootpathKeyboardShortcutTurnLeft(); +void WindowFootpathKeyboardShortcutTurnRight(); +void WindowFootpathKeyboardShortcutSlopeDown(); +void WindowFootpathKeyboardShortcutSlopeUp(); +void WindowFootpathKeyboardShortcutBuildCurrent(); +void WindowFootpathKeyboardShortcutDemolishCurrent(); -void window_follow_sprite(rct_window& w, EntityId spriteIndex); -void window_unfollow_sprite(rct_window& w); +void WindowFollowSprite(rct_window& w, EntityId spriteIndex); +void WindowUnfollowSprite(rct_window& w); -bool window_ride_construction_update_state( +bool WindowRideConstructionUpdateState( int32_t* trackType, int32_t* trackDirection, RideId* rideIndex, int32_t* _liftHillAndAlternativeState, CoordsXYZ* trackPos, int32_t* properties); -money32 place_provisional_track_piece( +money32 PlaceProvisionalTrackPiece( RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, const CoordsXYZ& trackPos); extern RideConstructionState _rideConstructionState2; -rct_window* window_get_listening(); -WindowClass window_get_classification(const rct_window& window); +rct_window* WindowGetListening(); +WindowClass WindowGetClassification(const rct_window& window); diff --git a/src/openrct2/interface/Window_internal.cpp b/src/openrct2/interface/Window_internal.cpp index d8e83d188a..7e0fad61fd 100644 --- a/src/openrct2/interface/Window_internal.cpp +++ b/src/openrct2/interface/Window_internal.cpp @@ -7,7 +7,7 @@ void rct_window::SetLocation(const CoordsXYZ& coords) { - window_scroll_to_location(*this, coords); + WindowScrollToLocation(*this, coords); flags &= ~WF_SCROLLING_TO_LOCATION; } @@ -18,9 +18,9 @@ void rct_window::ScrollToViewport() CoordsXYZ newCoords = focus.value().GetPos(); - auto mainWindow = window_get_main(); + auto mainWindow = WindowGetMain(); if (mainWindow != nullptr) - window_scroll_to_location(*mainWindow, newCoords); + WindowScrollToLocation(*mainWindow, newCoords); } void rct_window::Invalidate() diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index dacaee61bd..731461da6e 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -617,7 +617,7 @@ void award_update_all() if (res != std::end(_currentAwards)) { _currentAwards.erase(res, std::end(_currentAwards)); - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } // Only add new awards if park is open @@ -649,7 +649,7 @@ void award_update_all() { News::AddItemToQueue(News::ItemType::Award, AwardNewsStrings[EnumValue(awardType)], 0, {}); } - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } } } diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 112d438f91..4fd8f1ad45 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -280,7 +280,7 @@ void finance_update_daily_profit() gWeeklyProfitAverageDividend += gCurrentProfit; gWeeklyProfitAverageDivisor += 1; - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); } money64 finance_get_initial_cash() @@ -336,7 +336,7 @@ void finance_shift_expenditure_table() gExpenditureTable[0][i] = 0; } - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); } /** diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index d31fbdd0ee..ea47879a82 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -128,7 +128,7 @@ void marketing_update() } } - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); } void marketing_set_guest_campaign(Guest* peep, int32_t campaignType) diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 4cdf937d94..00334a9038 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -189,7 +189,7 @@ void News::ItemQueues::ArchiveCurrent() Archived.push_back(Current()); // Invalidate the news window - window_invalidate_by_class(WindowClass::RecentNews); + WindowInvalidateByClass(WindowClass::RecentNews); // Dequeue the current news item, shift news up Recent.pop_front(); @@ -449,7 +449,7 @@ void News::DisableNewsItems(News::ItemType type, uint32_t assoc) if (type == newsItem.Type && assoc == newsItem.Assoc) { newsItem.SetFlags(News::ItemFlags::HasButton); - window_invalidate_by_class(WindowClass::RecentNews); + WindowInvalidateByClass(WindowClass::RecentNews); } }); } diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 17442ee3cc..7068701049 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -124,8 +124,8 @@ static void research_calculate_expected_date() static void research_invalidate_related_windows() { - window_invalidate_by_class(WindowClass::ConstructRide); - window_invalidate_by_class(WindowClass::Research); + WindowInvalidateByClass(WindowClass::ConstructRide); + WindowInvalidateByClass(WindowClass::Research); } static void research_mark_as_fully_completed() diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7e4ba0476c..630d28461c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -644,7 +644,7 @@ void NetworkBase::UpdateClient() intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_disconnected }); ContextOpenIntent(&intent); } - window_close_by_class(WindowClass::Multiplayer); + WindowCloseByClass(WindowClass::Multiplayer); Close(); } else @@ -3023,7 +3023,7 @@ void NetworkBase::Server_Handle_PING(NetworkConnection& connection, [[maybe_unus if (connection.Player != nullptr) { connection.Player->Ping = ping; - window_invalidate_by_number(WindowClass::Player, connection.Player->Id); + WindowInvalidateByNumber(WindowClass::Player, connection.Player->Id); } } @@ -3042,7 +3042,7 @@ void NetworkBase::Client_Handle_PINGLIST([[maybe_unused]] NetworkConnection& con player->Ping = ping; } } - window_invalidate_by_class(WindowClass::Player); + WindowInvalidateByClass(WindowClass::Player); } void NetworkBase::Client_Handle_SETDISCONNECTMSG(NetworkConnection& connection, NetworkPacket& packet) @@ -3482,7 +3482,7 @@ GameActions::Result network_set_player_group( userManager.Save(); } - window_invalidate_by_number(WindowClass::Player, playerId); + WindowInvalidateByNumber(WindowClass::Player, playerId); // Log set player group event NetworkPlayer* game_command_player = network.GetPlayerByID(actionPlayerId); diff --git a/src/openrct2/network/NetworkPlayer.cpp b/src/openrct2/network/NetworkPlayer.cpp index 0de004f5e7..a01dc50850 100644 --- a/src/openrct2/network/NetworkPlayer.cpp +++ b/src/openrct2/network/NetworkPlayer.cpp @@ -40,7 +40,7 @@ void NetworkPlayer::AddMoneySpent(money32 cost) { MoneySpent += cost; CommandsRan++; - window_invalidate_by_number(WindowClass::Player, Id); + WindowInvalidateByNumber(WindowClass::Player, Id); } #endif diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 257770cf74..ec6b5fc4e5 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -492,7 +492,7 @@ private: // HACK Scenery window will lose its tabs after changing the scenery group indexing // for now just close it, but it will be better to later tell it to invalidate the tabs - window_close_by_class(WindowClass::Scenery); + WindowCloseByClass(WindowClass::Scenery); } ObjectEntryIndex GetPrimarySceneryGroupEntryIndex(Object* loadedObject) diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index de5774b758..3a8c8af947 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -2311,7 +2311,7 @@ int32_t scenario_save(u8string_view path, int32_t flags) gIsAutosave = flags & S6_SAVE_FLAG_AUTOMATIC; if (!gIsAutosave) { - window_close_construction_windows(); + WindowCloseConstructionWindows(); } PrepareMapForSave(); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index f167cf9f5c..0770eecd89 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -358,7 +358,7 @@ void ride_update_favourited_stat() } } - window_invalidate_by_class(WindowClass::RideList); + WindowInvalidateByClass(WindowClass::RideList); } /** @@ -741,7 +741,7 @@ bool Ride::FindTrackGap(const CoordsXYE& input, CoordsXYE* output) const if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) return false; - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == id) { ride_construction_invalidate_current_track(); @@ -958,7 +958,7 @@ void Ride::UpdateAll() return; } - window_update_viewport_ride_music(); + WindowUpdateViewportRideMusic(); // Update rides for (auto& ride : GetRideManager()) @@ -2665,7 +2665,7 @@ static ResultWithMessage RideCheckBlockBrakes(const CoordsXYE& input, CoordsXYE* return { false }; RideId rideIndex = input.element->AsTrack()->GetRideIndex(); - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) ride_construction_invalidate_current_track(); @@ -2729,7 +2729,7 @@ static bool ride_check_track_contains_inversions(const CoordsXYE& input, CoordsX return true; } - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); @@ -2789,7 +2789,7 @@ static bool ride_check_track_contains_banked(const CoordsXYE& input, CoordsXYE* if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) return true; - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); @@ -2830,7 +2830,7 @@ static bool ride_check_track_contains_banked(const CoordsXYE& input, CoordsXYE* */ static int32_t ride_check_station_length(const CoordsXYE& input, CoordsXYE* output) { - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == input.element->AsTrack()->GetRideIndex()) { @@ -2892,7 +2892,7 @@ static bool ride_check_start_and_end_is_station(const CoordsXYE& input) if (ride == nullptr) return false; - auto w = window_find_by_class(WindowClass::RideConstruction); + auto w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); @@ -3780,7 +3780,7 @@ static ResultWithMessage ride_create_cable_lift(RideId rideIndex, bool isApplyin */ void Ride::ConstructMissingEntranceOrExit() const { - auto* w = window_get_main(); + auto* w = WindowGetMain(); if (w == nullptr) return; @@ -3815,7 +3815,7 @@ void Ride::ConstructMissingEntranceOrExit() const if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) { auto location = incompleteStation->GetStart(); - window_scroll_to_location(*w, location); + WindowScrollToLocation(*w, location); CoordsXYE trackElement; ride_try_get_origin_element(*this, &trackElement); @@ -3826,9 +3826,9 @@ void Ride::ConstructMissingEntranceOrExit() const return; } - w = window_find_by_class(WindowClass::RideConstruction); + w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr) - window_event_mouse_up_call(w, entranceOrExit); + WindowEventMouseUpCall(w, entranceOrExit); } } @@ -3841,10 +3841,10 @@ static void ride_scroll_to_track_error(const CoordsXYE& trackElement) if (trackElement.element == nullptr) return; - auto* w = window_get_main(); + auto* w = WindowGetMain(); if (w != nullptr) { - window_scroll_to_location(*w, { trackElement, trackElement.element->GetBaseZ() }); + WindowScrollToLocation(*w, { trackElement, trackElement.element->GetBaseZ() }); ride_modify(trackElement); } } @@ -3884,7 +3884,7 @@ ResultWithMessage Ride::Test(bool isApplying) return { false }; } - window_close_by_number(WindowClass::RideConstruction, id.ToUnderlying()); + WindowCloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); StationIndex stationIndex = {}; auto message = ChangeStatusDoStationChecks(stationIndex); @@ -3972,7 +3972,7 @@ ResultWithMessage Ride::Open(bool isApplying) if (WindowClass::RideConstruction == gCurrentToolWidget.window_classification && id.ToUnderlying() == gCurrentToolWidget.window_number && (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) { - window_close_by_number(WindowClass::RideConstruction, id.ToUnderlying()); + WindowCloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); } StationIndex stationIndex = {}; @@ -4506,7 +4506,7 @@ void invalidate_test_results(Ride& ride) } } } - window_invalidate_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); } /** @@ -4836,7 +4836,7 @@ static int32_t ride_get_track_length(const Ride& ride) RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); - rct_window* w = window_find_by_class(WindowClass::RideConstruction); + rct_window* w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) { ride_construction_invalidate_current_track(); @@ -5020,7 +5020,7 @@ void Ride::UpdateMaxVehicles() { num_cars_per_train = numCarsPerTrain; NumTrains = numTrains; - window_invalidate_by_number(WindowClass::Ride, id.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, id.ToUnderlying()); } } @@ -5078,7 +5078,7 @@ void Ride::Crash(uint8_t vehicleIndex) intent.putExtra(INTENT_EXTRA_VEHICLE, vehicle); rct_window* w = ContextOpenIntent(&intent); - rct_viewport* viewport = window_get_viewport(w); + rct_viewport* viewport = WindowGetViewport(w); if (w != nullptr && viewport != nullptr) { viewport->flags |= VIEWPORT_FLAG_SOUND_ON; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 608a94499b..17f54f827d 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -123,7 +123,7 @@ static rct_window* ride_create_or_find_construction_window(RideId rideIndex) auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex.ToUnderlying()); windowManager->BroadcastIntent(intent); - return window_find_by_class(WindowClass::RideConstruction); + return WindowFindByClass(WindowClass::RideConstruction); } /** @@ -137,9 +137,9 @@ void RideConstructionStart(Ride& ride) { ride.FindTrackGap(trackElement, &trackElement); - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr && ride_modify(trackElement)) - window_scroll_to_location(*w, { trackElement, trackElement.element->GetBaseZ() }); + WindowScrollToLocation(*w, { trackElement, trackElement.element->GetBaseZ() }); } else { @@ -238,9 +238,9 @@ void ride_clear_for_construction(Ride& ride) ride.RemoveVehicles(); ride_clear_blocked_tiles(ride); - auto w = window_find_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + auto w = WindowFindByNumber(WindowClass::Ride, ride.id.ToUnderlying()); if (w != nullptr) - window_event_resize_call(w); + WindowEventResizeCall(w); } /** @@ -464,15 +464,13 @@ void ride_restore_provisional_track_piece() RideId rideIndex; int32_t direction, type, liftHillAndAlternativeState; CoordsXYZ trackPos; - if (window_ride_construction_update_state( - &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) + if (WindowRideConstructionUpdateState(&type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) { ride_construction_remove_ghosts(); } else { - _currentTrackPrice = place_provisional_track_piece( - rideIndex, type, direction, liftHillAndAlternativeState, trackPos); + _currentTrackPrice = PlaceProvisionalTrackPiece(rideIndex, type, direction, liftHillAndAlternativeState, trackPos); window_ride_construction_update_active_elements(); } } @@ -779,7 +777,7 @@ void ride_select_next_section() newCoords->x = outputElement.x; newCoords->y = outputElement.y; tileElement = outputElement.element; - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { // Set next element's height. VirtualFloorSetHeight(tileElement->GetBaseZ()); @@ -846,7 +844,7 @@ void ride_select_previous_section() _currentTrackPieceDirection = trackBeginEnd.begin_direction; _currentTrackPieceType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); _currentTrackSelectionFlags = 0; - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { // Set previous element's height. VirtualFloorSetHeight(trackBeginEnd.begin_element->GetBaseZ()); @@ -902,13 +900,13 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) auto stationIndex = entranceElement->GetStationIndex(); // Get or create construction window for ride - auto constructionWindow = window_find_by_class(WindowClass::RideConstruction); + auto constructionWindow = WindowFindByClass(WindowClass::RideConstruction); if (constructionWindow == nullptr) { if (!ride_initialise_construction_window(*ride)) return false; - constructionWindow = window_find_by_class(WindowClass::RideConstruction); + constructionWindow = WindowFindByClass(WindowClass::RideConstruction); if (constructionWindow == nullptr) return false; } @@ -918,7 +916,7 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) || gCurrentToolWidget.window_classification != WindowClass::RideConstruction) { // Replace entrance / exit - tool_set( + ToolSet( *constructionWindow, entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE : WC_RIDE_CONSTRUCTION__WIDX_EXIT, Tool::Crosshair); @@ -945,13 +943,13 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) gCurrentToolWidget.widget_index = entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE : WC_RIDE_CONSTRUCTION__WIDX_EXIT; gRideEntranceExitPlaceType = entranceType; - window_invalidate_by_class(WindowClass::RideConstruction); + WindowInvalidateByClass(WindowClass::RideConstruction); }); GameActions::Execute(&rideEntranceExitRemove); } - window_invalidate_by_class(WindowClass::RideConstruction); + WindowInvalidateByClass(WindowClass::RideConstruction); return true; } @@ -1100,7 +1098,7 @@ int32_t ride_initialise_construction_window(Ride& ride) { rct_window* w; - tool_cancel(); + ToolCancel(); if (!ride_check_if_construction_allowed(ride)) return 0; @@ -1110,7 +1108,7 @@ int32_t ride_initialise_construction_window(Ride& ride) w = ride_create_or_find_construction_window(ride.id); - tool_set(*w, WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT, Tool::Crosshair); + ToolSet(*w, WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); _currentTrackCurve = ride.GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 7b3a0bf37f..e3a3f6717d 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -306,7 +306,7 @@ static void ride_ratings_update_state_3(RideRatingUpdateState& state) ride_ratings_calculate(state, *ride); ride_ratings_calculate_value(*ride); - window_invalidate_by_number(WindowClass::Ride, state.CurrentRide.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, state.CurrentRide.ToUnderlying()); state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e195852f28..92443c4022 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -738,7 +738,7 @@ bool Vehicle::SoundCanPlay() const auto left = g_music_tracking_viewport->viewPos.x; auto bottom = g_music_tracking_viewport->viewPos.y; - if (window_get_classification(*gWindowAudioExclusive) == WindowClass::MainWindow) + if (WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) { left -= quarter_w; bottom -= quarter_h; @@ -750,7 +750,7 @@ bool Vehicle::SoundCanPlay() const auto right = g_music_tracking_viewport->view_width + left; auto top = g_music_tracking_viewport->view_height + bottom; - if (window_get_classification(*gWindowAudioExclusive) == WindowClass::MainWindow) + if (WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) { right += quarter_w + quarter_w; top += quarter_h + quarter_h; @@ -883,13 +883,13 @@ static void vehicle_sounds_update_window_setup() { g_music_tracking_viewport = nullptr; - rct_window* window = window_get_listening(); + rct_window* window = WindowGetListening(); if (window == nullptr) { return; } - rct_viewport* viewport = window_get_viewport(window); + rct_viewport* viewport = WindowGetViewport(window); if (viewport == nullptr) { return; @@ -1459,7 +1459,7 @@ void Vehicle::UpdateMeasurements() curRide->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS; curRide->lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; ClearUpdateFlag(VEHICLE_UPDATE_FLAG_TESTING); - window_invalidate_by_number(WindowClass::Ride, ride.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, ride.ToUnderlying()); return; } @@ -2952,7 +2952,7 @@ static void test_finish(Ride& ride) totalTime = std::max(totalTime, 1u); ride.average_speed = ride.average_speed / totalTime; - window_invalidate_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); } void Vehicle::UpdateTestFinish() @@ -3002,7 +3002,7 @@ static void test_reset(Ride& ride, StationIndex curStation) } ride.total_air_time = 0; ride.current_test_station = curStation; - window_invalidate_by_number(WindowClass::Ride, ride.id.ToUnderlying()); + WindowInvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); } void Vehicle::TestReset() diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 8acb7fe71e..392a1ccb87 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -188,8 +188,8 @@ void scenario_reset() static void scenario_end() { game_reset_speed(); - window_close_by_class(WindowClass::Dropdown); - window_close_all_except_flags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); + WindowCloseByClass(WindowClass::Dropdown); + WindowCloseAllExceptFlags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); ContextOpenWindowView(WV_PARK_OBJECTIVE); } diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 26d306ae2e..e1fe4bd710 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -120,7 +120,7 @@ namespace OpenRCT2::Scripting if (gParkEntranceFee != value) { gParkEntranceFee = value; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } } @@ -207,7 +207,7 @@ namespace OpenRCT2::Scripting if (gTotalAdmissions != value) { gTotalAdmissions = value; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } } @@ -222,7 +222,7 @@ namespace OpenRCT2::Scripting if (gTotalIncomeFromAdmissions != value) { gTotalIncomeFromAdmissions = value; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } } diff --git a/src/openrct2/title/Command/FollowEntity.cpp b/src/openrct2/title/Command/FollowEntity.cpp index b85e06049e..239dec7fd6 100644 --- a/src/openrct2/title/Command/FollowEntity.cpp +++ b/src/openrct2/title/Command/FollowEntity.cpp @@ -15,10 +15,10 @@ namespace OpenRCT2::Title { int16_t FollowEntityCommand::operator()(int16_t timer) { - auto* w = window_get_main(); + auto* w = WindowGetMain(); if (w != nullptr) { - window_follow_sprite(*w, Follow.SpriteIndex); + WindowFollowSprite(*w, Follow.SpriteIndex); } return 0; diff --git a/src/openrct2/title/Command/RotateView.cpp b/src/openrct2/title/Command/RotateView.cpp index dacc898c34..3eec7568eb 100644 --- a/src/openrct2/title/Command/RotateView.cpp +++ b/src/openrct2/title/Command/RotateView.cpp @@ -15,12 +15,12 @@ namespace OpenRCT2::Title { int16_t RotateViewCommand::operator()(int16_t timer) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { for (uint_fast8_t i = 0; i < Rotations; i++) { - window_rotate_camera(*w, 1); + WindowRotateCamera(*w, 1); } } diff --git a/src/openrct2/title/Command/SetLocation.cpp b/src/openrct2/title/Command/SetLocation.cpp index 55356c6cc5..32b7356678 100644 --- a/src/openrct2/title/Command/SetLocation.cpp +++ b/src/openrct2/title/Command/SetLocation.cpp @@ -18,7 +18,7 @@ namespace OpenRCT2::Title { int16_t SetLocationCommand::operator()(int16_t timer) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { auto loc = TileCoordsXY(Location.X, Location.Y).ToCoordsXY().ToTileCentre(); diff --git a/src/openrct2/title/Command/SetZoom.cpp b/src/openrct2/title/Command/SetZoom.cpp index c5d2e5c83b..273bd43b9c 100644 --- a/src/openrct2/title/Command/SetZoom.cpp +++ b/src/openrct2/title/Command/SetZoom.cpp @@ -16,10 +16,10 @@ namespace OpenRCT2::Title { int16_t SetZoomCommand::operator()(int16_t timer) { - rct_window* w = window_get_main(); + rct_window* w = WindowGetMain(); if (w != nullptr) { - window_zoom_set(*w, ZoomLevel{ static_cast(Zoom) }, false); + WindowZoomSet(*w, ZoomLevel{ static_cast(Zoom) }, false); } return 0; diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index 07a436ee84..3e09a04def 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -86,10 +86,10 @@ void TitleScreen::StopPreviewingSequence() { if (_previewingSequence) { - rct_window* mainWindow = window_get_main(); + rct_window* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - window_unfollow_sprite(*mainWindow); + WindowUnfollowSprite(*mainWindow); } _previewingSequence = false; _currentSequence = title_get_config_sequence(); @@ -183,7 +183,7 @@ void TitleScreen::Tick() input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false); ContextUpdateMapTooltip(); - window_dispatch_update_all(); + WindowDispatchUpdateAll(); gSavedAge++; @@ -205,7 +205,7 @@ void TitleScreen::ChangePresetSequence(size_t preset) if (!_previewingSequence) _currentSequence = preset; - window_invalidate_all(); + WindowInvalidateAll(); } /** @@ -218,7 +218,7 @@ void TitleScreen::CreateWindows() ContextOpenWindow(WindowClass::TitleExit); ContextOpenWindow(WindowClass::TitleOptions); ContextOpenWindow(WindowClass::TitleLogo); - window_resize_gui(ContextGetWidth(), ContextGetHeight()); + WindowResizeGui(ContextGetWidth(), ContextGetHeight()); _hideVersionInfo = false; } diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 5117e4524a..9c902fcada 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -39,7 +39,7 @@ RideConstructionState _rideConstructionState2; * * rct2: 0x006CA162 */ -money32 place_provisional_track_piece( +money32 PlaceProvisionalTrackPiece( RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, const CoordsXYZ& trackPos) { auto ride = get_ride(rideIndex); @@ -67,7 +67,7 @@ money32 place_provisional_track_piece( // Invalidate previous track piece (we may not be changing height!) VirtualFloorInvalidate(); - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { // Set new virtual floor height. VirtualFloorSetHeight(trackPos.z); @@ -109,7 +109,7 @@ money32 place_provisional_track_piece( // Invalidate previous track piece (we may not be changing height!) VirtualFloorInvalidate(); - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { // Set height to where the next track piece would begin VirtualFloorSetHeight(trackPos.z - z_begin + z_end); @@ -235,7 +235,7 @@ static std::tuple window_ride_construction_update_state_get_ * @param[out] _properties (edirs16) * @return (CF) */ -bool window_ride_construction_update_state( +bool WindowRideConstructionUpdateState( int32_t* _trackType, int32_t* _trackDirection, RideId* _rideIndex, int32_t* _liftHillAndInvertedState, CoordsXYZ* _trackPos, int32_t* _properties) { @@ -405,7 +405,7 @@ void window_ride_construction_update_active_elements() * * rct2: 0x0066DB3D */ -bool scenery_tool_is_active() +bool SceneryToolIsActive() { auto toolWindowClassification = gCurrentToolWidget.window_classification; WidgetIndex toolWidgetIndex = gCurrentToolWidget.widget_index; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 087dd12191..097a728cd6 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -169,7 +169,7 @@ money32 FootpathProvisionalSet( // Invalidate previous footpath piece. VirtualFloorInvalidate(); - if (!scenery_tool_is_active()) + if (!SceneryToolIsActive()) { if (res.Error != GameActions::Status::Ok) { @@ -241,7 +241,7 @@ void FootpathProvisionalUpdate() */ CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) { - rct_window* window = window_find_from_point(screenCoords); + rct_window* window = WindowFindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { CoordsXY position{}; @@ -339,7 +339,7 @@ CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32 CoordsXY FootpathBridgeGetInfoFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) { // First check if we point at an entrance or exit. In that case, we would want the path coming from the entrance/exit. - rct_window* window = window_find_from_point(screenCoords); + rct_window* window = WindowFindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { CoordsXY ret{}; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 89f198d933..84ab1ef991 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1353,14 +1353,14 @@ void MapRemoveProvisionalElements() FootpathProvisionalRemove(); gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_1; } - if (window_find_by_class(WindowClass::RideConstruction) != nullptr) + if (WindowFindByClass(WindowClass::RideConstruction) != nullptr) { ride_remove_provisional_track_piece(); RideEntranceExitRemoveGhost(); } // This is in non performant so only make network games suffer for it // non networked games do not need this as its to prevent desyncs. - if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr) + if ((network_get_mode() != NETWORK_MODE_NONE) && WindowFindByClass(WindowClass::TrackDesignPlace) != nullptr) { auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL); ContextBroadcastIntent(&intent); @@ -1378,14 +1378,14 @@ void MapRestoreProvisionalElements() gProvisionalFootpath.SurfaceIndex, gProvisionalFootpath.RailingsIndex, gProvisionalFootpath.Position, gProvisionalFootpath.Slope, gProvisionalFootpath.ConstructFlags); } - if (window_find_by_class(WindowClass::RideConstruction) != nullptr) + if (WindowFindByClass(WindowClass::RideConstruction) != nullptr) { ride_restore_provisional_track_piece(); RideEntranceExitPlaceProvisionalGhost(); } // This is in non performant so only make network games suffer for it // non networked games do not need this as its to prevent desyncs. - if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr) + if ((network_get_mode() != NETWORK_MODE_NONE) && WindowFindByClass(WindowClass::TrackDesignPlace) != nullptr) { auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_RESTORE_PROVISIONAL); ContextBroadcastIntent(&intent); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 5f61ba6bcc..ec12edc381 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -323,7 +323,7 @@ void Park::Update(const Date& date) _suggestedGuestMaximum = CalculateSuggestedMaxGuests(); _guestGenerationProbability = CalculateGuestGenerationProbability(); - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::Finances); auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); ContextBroadcastIntent(&intent); } @@ -332,7 +332,7 @@ void Park::Update(const Date& date) if (gCurrentTicks % 4096 == 0) { gParkSize = CalculateParkSize(); - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } GenerateGuests(); @@ -357,7 +357,7 @@ uint32_t Park::CalculateParkSize() const if (tiles != gParkSize) { gParkSize = tiles; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } return tiles; @@ -774,8 +774,8 @@ void Park::UpdateHistories() // Invalidate relevant windows auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); ContextBroadcastIntent(&intent); - window_invalidate_by_class(WindowClass::ParkInformation); - window_invalidate_by_class(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::Finances); } int32_t ParkIsOpen() @@ -789,7 +789,7 @@ uint32_t ParkCalculateSize() if (tiles != gParkSize) { gParkSize = tiles; - window_invalidate_by_class(WindowClass::ParkInformation); + WindowInvalidateByClass(WindowClass::ParkInformation); } return tiles; } diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 267665c44c..4891ae6465 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -81,7 +81,7 @@ void TileElement::RemoveBannerEntry() auto banner = GetBanner(bannerIndex); if (banner != nullptr) { - window_close_by_number(WindowClass::Banner, bannerIndex.ToUnderlying()); + WindowCloseByNumber(WindowClass::Banner, bannerIndex.ToUnderlying()); DeleteBanner(banner->id); } } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 3a039fecb8..d1aa4280ed 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -78,7 +78,7 @@ namespace OpenRCT2::TileInspector static rct_window* GetTileInspectorWithPos(const CoordsXY& loc) { // Return the tile inspector window for everyone who has the tile selected - auto* window = window_find_by_class(WindowClass::TileInspector); + auto* window = WindowFindByClass(WindowClass::TileInspector); if (window != nullptr && loc == windowTileInspectorTile.ToCoordsXY()) { return window; @@ -313,7 +313,7 @@ namespace OpenRCT2::TileInspector MapInvalidateTileFull(loc); if (loc == windowTileInspectorTile.ToCoordsXY()) { - window_invalidate_by_class(WindowClass::TileInspector); + WindowInvalidateByClass(WindowClass::TileInspector); } return GameActions::Result();