diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index ea404331f5..00993ddc87 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -658,7 +658,7 @@ public: return nullptr; } - static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, int32_t width, int32_t height) + static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, const ScreenSize windowSize) { for (auto& w : g_window_list) { @@ -667,11 +667,11 @@ public: if (w->flags & WF_STICK_TO_BACK) continue; - if (loc.x + width <= w->windowPos.x) + if (loc.x + windowSize.width <= w->windowPos.x) continue; if (loc.x >= w->windowPos.x + w->width) continue; - if (loc.y + height <= w->windowPos.y) + if (loc.y + windowSize.height <= w->windowPos.y) continue; if (loc.y >= w->windowPos.y + w->height) continue; @@ -681,26 +681,26 @@ public: return true; } - static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, int32_t width, int32_t height) + static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, ScreenSize windowSize) { if (loc.x < 0) return false; if (loc.y <= kTopToolbarHeight && gLegacyScene != LegacyScene::titleSequence) return false; - if (loc.x + width > ContextGetWidth()) + if (loc.x + windowSize.width > ContextGetWidth()) return false; - if (loc.y + height > ContextGetHeight()) + if (loc.y + windowSize.height > ContextGetHeight()) return false; - return WindowFitsBetweenOthers(loc, width, height); + return WindowFitsBetweenOthers(loc, windowSize); } - static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, int32_t width, int32_t height) + static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, const ScreenSize windowSize) { uint16_t screenWidth = ContextGetWidth(); uint16_t screenHeight = ContextGetHeight(); int32_t unk; - unk = -(width / 4); + unk = -(windowSize.width / 4); if (loc.x < unk) return false; unk = screenWidth + (unk * 2); @@ -708,50 +708,48 @@ public: return false; if (loc.y <= kTopToolbarHeight && gLegacyScene != LegacyScene::titleSequence) return false; - unk = screenHeight - (height / 4); + unk = screenHeight - (windowSize.height / 4); if (loc.y > unk) return false; - return WindowFitsBetweenOthers(loc, width, height); + return WindowFitsBetweenOthers(loc, windowSize); } static ScreenCoordsXY ClampWindowToScreen( - const ScreenCoordsXY& pos, const int32_t screenWidth, const int32_t screenHeight, const int32_t width, - const int32_t height) + const ScreenCoordsXY& pos, const ScreenSize screenSize, const ScreenSize windowSize) { auto screenPos = pos; - if (width > screenWidth || screenPos.x < 0) + if (windowSize.width > screenSize.width || screenPos.x < 0) screenPos.x = 0; - else if (screenPos.x + width > screenWidth) - screenPos.x = screenWidth - width; + else if (screenPos.x + windowSize.width > screenSize.width) + screenPos.x = screenSize.width - windowSize.width; auto toolbarAllowance = gLegacyScene == LegacyScene::titleSequence ? 0 : (kTopToolbarHeight + 1); - if (height - toolbarAllowance > screenHeight || screenPos.y < toolbarAllowance) + if (windowSize.height - toolbarAllowance > screenSize.height || screenPos.y < toolbarAllowance) screenPos.y = toolbarAllowance; - else if (screenPos.y + height - toolbarAllowance > screenHeight) - screenPos.y = screenHeight + toolbarAllowance - height; + else if (screenPos.y + windowSize.height - toolbarAllowance > screenSize.height) + screenPos.y = screenSize.height + toolbarAllowance - windowSize.height; return screenPos; } - static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) + static ScreenCoordsXY GetAutoPositionForNewWindow(const ScreenSize windowSize) { auto& uiContext = GetContext()->GetUiContext(); - auto screenWidth = uiContext.GetWidth(); - auto screenHeight = uiContext.GetHeight(); + ScreenSize screenSize = { uiContext.GetWidth(), uiContext.GetHeight() }; // Place window in an empty corner of the screen const ScreenCoordsXY cornerPositions[] = { - { 0, 30 }, // topLeft - { screenWidth - width, 30 }, // topRight - { 0, screenHeight - 34 - height }, // bottomLeft - { screenWidth - width, screenHeight - 34 - height }, // bottomRight + { 0, 30 }, // topLeft + { screenSize.width - windowSize.width, 30 }, // topRight + { 0, screenSize.height - 34 - windowSize.height }, // bottomLeft + { screenSize.width - windowSize.width, screenSize.height - 34 - windowSize.height }, // bottomRight }; for (const auto& cornerPos : cornerPositions) { - if (WindowFitsWithinSpace(cornerPos, width, height)) + if (WindowFitsWithinSpace(cornerPos, windowSize)) { - return ClampWindowToScreen(cornerPos, screenWidth, screenHeight, width, height); + return ClampWindowToScreen(cornerPos, screenSize, windowSize); } } @@ -777,9 +775,9 @@ public: for (const auto& offset : offsets) { auto screenPos = w->windowPos + offset; - if (WindowFitsWithinSpace(screenPos, width, height)) + if (WindowFitsWithinSpace(screenPos, windowSize)) { - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + return ClampWindowToScreen(screenPos, screenSize, windowSize); } } } @@ -802,9 +800,9 @@ public: for (const auto& offset : offsets) { auto screenPos = w->windowPos + offset; - if (WindowFitsOnScreen(screenPos, width, height)) + if (WindowFitsOnScreen(screenPos, windowSize)) { - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + return ClampWindowToScreen(screenPos, screenSize, windowSize); } } } @@ -820,36 +818,37 @@ public: } } - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + return ClampWindowToScreen(screenPos, screenSize, windowSize); } - static ScreenCoordsXY GetCentrePositionForNewWindow(int32_t width, int32_t height) + static ScreenCoordsXY GetCentrePositionForNewWindow(ScreenSize size) { auto& uiContext = GetContext()->GetUiContext(); auto screenWidth = uiContext.GetWidth(); auto screenHeight = uiContext.GetHeight(); - return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - height) / 2) }; + return ScreenCoordsXY{ (screenWidth - size.width) / 2, + std::max(kTopToolbarHeight + 1, (screenHeight - size.height) / 2) }; } WindowBase* Create( - std::unique_ptr&& wp, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, + std::unique_ptr&& wp, WindowClass cls, ScreenCoordsXY pos, ScreenSize windowSize, WindowFlags flags) override { - height += wp->getTitleBarDiffTarget(); + windowSize.height += wp->getTitleBarDiffTarget(); if (flags & WF_AUTO_POSITION) { if (flags & WF_CENTRE_SCREEN) { - pos = GetCentrePositionForNewWindow(width, height); + pos = GetCentrePositionForNewWindow(windowSize); } else { - pos = GetAutoPositionForNewWindow(width, height); + pos = GetAutoPositionForNewWindow(windowSize); } } - height -= wp->getTitleBarDiffTarget(); + windowSize.height -= wp->getTitleBarDiffTarget(); // Check if there are any window slots left // include kWindowLimitReserved for items such as the main viewport and toolbars to not appear to be counted. @@ -907,16 +906,16 @@ public: if (!(flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) { w->flags |= WF_WHITE_BORDER_MASK; - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 0, pos.x + (width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 0, pos.x + (windowSize.width / 2)); } w->windowPos = pos; - w->width = width; - w->height = height; - w->min_width = width; - w->max_width = width; - w->min_height = height; - w->max_height = height; + w->width = windowSize.width; + w->height = windowSize.height; + w->min_width = windowSize.width; + w->max_width = windowSize.width; + w->min_height = windowSize.height; + w->max_height = windowSize.height; w->focus = std::nullopt; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 385118271f..b8be4b24e5 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -1141,11 +1141,12 @@ namespace OpenRCT2::Ui::Windows if (desc.X && desc.Y) { window = windowMgr->Create( - WindowClass::Custom, { *desc.X, *desc.Y }, desc.Width, desc.Height, windowFlags, owner, desc); + WindowClass::Custom, { *desc.X, *desc.Y }, { desc.Width, desc.Height }, windowFlags, owner, desc); } else { - window = windowMgr->Create(WindowClass::Custom, desc.Width, desc.Height, windowFlags, owner, desc); + window = windowMgr->Create( + WindowClass::Custom, { desc.Width, desc.Height }, windowFlags, owner, desc); } return window; } diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 76db03ca44..744e623862 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -288,6 +288,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* AboutOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::About, WW, WH, WF_CENTRE_SCREEN); + return windowMgr->FocusOrCreate(WindowClass::About, { WW, WH }, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index b72e75af2e..15d1a5cb1a 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -344,6 +344,6 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN; - return windowMgr->FocusOrCreate(WindowClass::AssetPacks, WW, WH, flags); + return windowMgr->FocusOrCreate(WindowClass::AssetPacks, { WW, WH }, flags); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 2a294357ea..d3418e8712 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -317,7 +317,7 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) return w; - w = windowMgr->Create(WindowClass::Banner, WW, WH, 0); + w = windowMgr->Create(WindowClass::Banner, { WW, WH }, 0); if (w != nullptr) w->Initialise(number); diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 48b9c4db41..5d74475e5f 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -286,7 +286,7 @@ namespace OpenRCT2::Ui::Windows int32_t width = (ContextGetWidth() * 4) / 5; int32_t height = (ContextGetHeight() * 4) / 5; auto* newWindow = windowMgr->Create( - WindowClass::Changelog, width, height, WF_CENTRE_SCREEN | WF_RESIZABLE); + WindowClass::Changelog, { width, height }, WF_CENTRE_SCREEN | WF_RESIZABLE); newWindow->SetPersonality(personality); return newWindow; } diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 34cd3989b2..5001e59c7e 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -1352,7 +1352,7 @@ static StringId window_cheats_page_titles[] = { auto* window = windowMgr->BringToFrontByClass(WindowClass::Cheats); if (window == nullptr) { - window = windowMgr->Create(WindowClass::Cheats, ScreenCoordsXY(32, 32), WW, WH); + window = windowMgr->Create(WindowClass::Cheats, ScreenCoordsXY(32, 32), { WW, WH }); } return window; } diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 107f53d510..15d19a5625 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -369,7 +369,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0); } /** diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 4684a69671..e52448a886 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -227,6 +227,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* CustomCurrencyOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::CustomCurrencyConfig, WW, WH, WF_CENTRE_SCREEN); + return windowMgr->FocusOrCreate(WindowClass::CustomCurrencyConfig, { WW, WH }, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 82ed264df4..645241685e 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -156,7 +156,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FocusOrCreate( - WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, + WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, { WINDOW_WIDTH, WINDOW_HEIGHT }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_TITLE_BAR); return window; diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 41a3f2d15b..b0d3c128c6 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -105,12 +105,12 @@ namespace OpenRCT2::Ui::Windows windowMgr->Close(*w); newWindow = windowMgr->Create( - WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); + WindowClass::DemolishRidePrompt, windowPos, { WW, WH }, WF_TRANSPARENT); } else { newWindow = windowMgr->Create( - WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + WindowClass::DemolishRidePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT); } newWindow->SetRide(ride); diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 4b50a771d1..3db60d7c42 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -365,7 +365,7 @@ namespace OpenRCT2::Ui::Windows // Create the window (width/height position are set later) auto* windowMgr = GetWindowManager(); auto* w = windowMgr->Create( - WindowClass::Dropdown, width, customItemHeight, WF_STICK_TO_FRONT | WF_NO_TITLE_BAR); + WindowClass::Dropdown, { width, customItemHeight }, WF_STICK_TO_FRONT | WF_NO_TITLE_BAR); if (w != nullptr) { auto numRowsPerColumn = prefRowsPerColumn > 0 ? static_cast(prefRowsPerColumn) : Dropdown::kItemsMaxSize; @@ -400,7 +400,7 @@ namespace OpenRCT2::Ui::Windows // Create the window (width/height position are set later) auto* windowMgr = GetWindowManager(); - auto* w = windowMgr->Create(WindowClass::Dropdown, itemWidth, itemHeight, WF_STICK_TO_FRONT); + auto* w = windowMgr->Create(WindowClass::Dropdown, { itemWidth, itemHeight }, WF_STICK_TO_FRONT); if (w != nullptr) { w->SetImageItems({ x, y }, extray, colour, numItems, itemWidth, itemHeight, numColumns); diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 0c22222bd0..6651eb8ce3 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -446,7 +446,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); auto* window = windowMgr->Create( - WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, + WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), { ContextGetWidth(), 32 }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR); return window; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 97039cbfc6..5b7380af56 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -588,7 +588,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); + WindowClass::EditorInventionList, { WW, WH }, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); } #pragma endregion @@ -686,7 +686,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = Ui::GetWindowManager(); windowMgr->CloseByClass(WindowClass::EditorInventionListDrag); auto* wnd = windowMgr->Create( - WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); + WindowClass::EditorInventionListDrag, { 10, 14 }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); if (wnd != nullptr) { wnd->Init(*researchItem, editorPos, objectSelectionScrollWidth); diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index b6175dec34..9487470a60 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1631,7 +1631,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); + WindowClass::EditorObjectSelection, { 755, 400 }, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); } // Used for forced closure diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 6db75fe6f5..718fe40051 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -396,7 +396,7 @@ namespace OpenRCT2::Ui::Windows return window; window = windowMgr->Create( - WindowClass::EditorParkEntrance, kWindowWidth, kWindowHeight, WF_10 | WF_RESIZABLE); + WindowClass::EditorParkEntrance, { kWindowWidth, kWindowHeight }, WF_10 | WF_RESIZABLE); return window; } diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 460a1d55b4..b757940430 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -2370,6 +2370,6 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING | WF_CENTRE_SCREEN); + WindowClass::EditorScenarioOptions, { 280, 148 }, WF_NO_SCROLLING | WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 83406e94b6..197b2a73a8 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -142,7 +142,7 @@ namespace OpenRCT2::Ui::Windows auto errorWindow = std::make_unique(std::move(buffer), numLines, autoClose); return windowMgr->Create( - std::move(errorWindow), WindowClass::Error, windowPosition, width, height, + std::move(errorWindow), WindowClass::Error, windowPosition, { width, height }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_TITLE_BAR); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 6e444e4226..f2f88967bb 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -881,7 +881,8 @@ namespace OpenRCT2::Ui::Windows static FinancesWindow* FinancesWindowOpen(uint8_t page) { auto* windowMgr = Ui::GetWindowManager(); - auto* window = windowMgr->FocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, kHeightSummary, WF_10); + auto* window = windowMgr->FocusOrCreate( + WindowClass::Finances, { WW_OTHER_TABS, kHeightSummary }, WF_10); if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY) window->SetPage(page); @@ -892,7 +893,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* FinancesOpen() { auto* windowMgr = Ui::GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, kHeightSummary, WF_10); + return windowMgr->FocusOrCreate(WindowClass::Finances, { WW_OTHER_TABS, kHeightSummary }, WF_10); } WindowBase* FinancesResearchOpen() diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 3fd357bcab..0ada0e4416 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1634,7 +1634,7 @@ namespace OpenRCT2::Ui::Windows } auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); + return windowMgr->FocusOrCreate(WindowClass::Footpath, { WW_WINDOW, WH_WINDOW }, 0); } void WindowFootpathResetSelectedPath() diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index e09829b0e8..957f2aa443 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -687,11 +687,11 @@ namespace OpenRCT2::Ui::Windows // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - uint32_t toolbar_height = line_height * 2 + 12; + int32_t toolbar_height = line_height * 2 + 12; auto* windowMgr = GetWindowManager(); auto* window = windowMgr->Create( - WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbar_height), screenWidth, toolbar_height, + WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbar_height), { screenWidth, toolbar_height }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR); return window; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 68dd383cf1..dd3e5e9455 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1916,7 +1916,7 @@ namespace OpenRCT2::Ui::Windows if (Config::Get().general.DebuggingTools) windowWidth += TabWidth; - window = windowMgr->Create(WindowClass::Peep, windowWidth, 157, WF_RESIZABLE); + window = windowMgr->Create(WindowClass::Peep, { windowWidth, 157 }, WF_RESIZABLE); if (window == nullptr) { return nullptr; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 465525550a..d549932d92 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -955,7 +955,7 @@ namespace OpenRCT2::Ui::Windows auto* window = windowMgr->BringToFrontByClass(WindowClass::GuestList); if (window == nullptr) { - window = windowMgr->Create(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); + window = windowMgr->Create(WindowClass::GuestList, { 350, 330 }, WF_10 | WF_RESIZABLE); } return window; } diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 5f0d07db54..2fc448747f 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -424,7 +424,7 @@ namespace OpenRCT2::Ui::Windows _currentTrackPieceDirection = 2; auto* window = windowMgr->FocusOrCreate( - WindowClass::InstallTrack, WW, WH, WF_AUTO_POSITION | WF_CENTRE_SCREEN); + WindowClass::InstallTrack, { WW, WH }, WF_AUTO_POSITION | WF_CENTRE_SCREEN); window->SetupTrack(path, std::move(trackDesign)); return window; diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index efd6fe9cf6..d018ead75c 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -868,7 +868,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* LandOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + return windowMgr->FocusOrCreate( + WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0); } /** diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index dba503751e..48b1a91115 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -592,6 +592,6 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index ba4363c5b3..ac5da60d51 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -1135,8 +1135,8 @@ namespace OpenRCT2::Ui::Windows auto height = config.FileBrowserHeight; w = windowMgr->Create( - WindowClass::Loadsave, width, height, WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, - action, type); + WindowClass::Loadsave, { width, height }, + WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, action, type); } bool isSave = action == LoadSaveAction::save; diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 209fd029bd..f88a6178f4 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -78,6 +78,6 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->Create( - WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK | WF_NO_TITLE_BAR); + WindowClass::MainWindow, { 0, 0 }, { ContextGetWidth(), ContextGetHeight() }, WF_STICK_TO_BACK | WF_NO_TITLE_BAR); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 779dc6b530..68fd9b05e2 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1255,7 +1255,7 @@ namespace OpenRCT2::Ui::Windows try { auto* windowMgr = GetWindowManager(); - auto* w = windowMgr->FocusOrCreate(WindowClass::Map, 245, 259, WF_10); + auto* w = windowMgr->FocusOrCreate(WindowClass::Map, { 245, 259 }, WF_10); w->selected_tab = 0; w->list_information_type = 0; return w; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 2248bcdd94..528edd7551 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -1535,7 +1535,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::Mapgen, kWindowSize.width, kWindowSize.height, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); + WindowClass::Mapgen, kWindowSize, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); } static void HeightmapLoadsaveCallback(ModalResult result, const utf8* path) diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index ecf4029b73..b8c3a3abda 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -128,7 +128,7 @@ namespace OpenRCT2::Ui::Windows else { w = windowMgr->Create( - WindowClass::MapTooltip, pos, width, height, + WindowClass::MapTooltip, pos, { width, height }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR); } } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index ef8da3de93..e9c226626f 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -443,7 +443,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE); } void WindowMazeConstructionUpdatePressedWidgets() diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index aaafea602c..4f525b71a1 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -189,7 +189,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { window = windowMgr->Create( - WindowClass::Multiplayer, 320, 144, WF_10 | WF_RESIZABLE | WF_AUTO_POSITION); + WindowClass::Multiplayer, { 320, 144 }, WF_10 | WF_RESIZABLE | WF_AUTO_POSITION); } return window; diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 0f689d2e3a..e4ed351f9f 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -135,7 +135,7 @@ namespace OpenRCT2::Ui::Windows else { window = windowMgr->Create( - WindowClass::NetworkStatus, 400, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + WindowClass::NetworkStatus, { 400, 90 }, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); } window->SetCloseCallBack(onClose); @@ -163,7 +163,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FocusOrCreate( - WindowClass::NetworkStatus, 400, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); + WindowClass::NetworkStatus, { 400, 90 }, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); char password[33]{}; WindowTextInputRawOpen(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, {}, password, 32); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 9f8204bf7c..625b94c6ce 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -408,7 +408,7 @@ namespace OpenRCT2::Ui::Windows w->Close(); } - w = windowMgr->Create(WindowClass::NewCampaign, WW, WH, 0); + w = windowMgr->Create(WindowClass::NewCampaign, { WW, WH }, 0); if (w != nullptr) { w->SetCampaign(campaignType); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 09e3ee172d..2820aabe64 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseByClass(WindowClass::TrackDesignPlace); window = windowMgr->Create( - WindowClass::ConstructRide, WindowWidth, kWindowHeight, WF_10 | WF_AUTO_POSITION); + WindowClass::ConstructRide, { WindowWidth, kWindowHeight }, WF_10 | WF_AUTO_POSITION); return window; } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 37e33f8c1d..a780132bd1 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -582,6 +582,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* NewsOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::RecentNews, WW, WH, 0); + return windowMgr->FocusOrCreate(WindowClass::RecentNews, { WW, WH }, 0); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index fef1cc10e7..e46985a117 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -578,7 +578,7 @@ namespace OpenRCT2::Ui::Windows auto* window = windowMgr->BringToFrontByClass(WindowClass::ObjectLoadError); if (window == nullptr) { - window = windowMgr->Create(WindowClass::ObjectLoadError, WW, WH, 0); + window = windowMgr->Create(WindowClass::ObjectLoadError, { WW, WH }, 0); } static_cast(window)->Initialise(path, numMissingObjects, missingObjects); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 25a789101e..c3b4a51b5c 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2430,6 +2430,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* OptionsOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::Options, WW, WH, WF_CENTRE_SCREEN); + return windowMgr->FocusOrCreate(WindowClass::Options, { WW, WH }, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/OverwritePrompt.cpp b/src/openrct2-ui/windows/OverwritePrompt.cpp index f1bf92ee5e..1fdd781447 100644 --- a/src/openrct2-ui/windows/OverwritePrompt.cpp +++ b/src/openrct2-ui/windows/OverwritePrompt.cpp @@ -107,7 +107,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseByClass(WindowClass::LoadsaveOverwritePrompt); return windowMgr->Create( - WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, + WindowClass::LoadsaveOverwritePrompt, { OVERWRITE_WW, OVERWRITE_WH }, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name, path, action, type, trackDesignPtr); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 93af8de9fb..218b59ef6a 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1310,7 +1310,7 @@ namespace OpenRCT2::Ui::Windows static ParkWindow* ParkWindowOpen(uint8_t page) { auto* windowMgr = GetWindowManager(); - auto* wnd = windowMgr->FocusOrCreate(WindowClass::ParkInformation, 230, 174 + 9, WF_10); + auto* wnd = windowMgr->FocusOrCreate(WindowClass::ParkInformation, { 230, 174 + 9 }, WF_10); if (wnd != nullptr && page != WINDOW_PARK_PAGE_ENTRANCE) { wnd->OnMouseUp(WIDX_TAB_1 + page); diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 91a73fbba9..1fd8b1aef8 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -292,7 +292,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FocusOrCreate( - WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0); if (w != nullptr) { w->SetStaffId(staffId); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 3d51ededb2..a596c9ddf9 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -629,7 +629,7 @@ namespace OpenRCT2::Ui::Windows auto* window = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Player, id)); if (window == nullptr) { - window = windowMgr->Create(WindowClass::Player, 240, 170, WF_RESIZABLE); + window = windowMgr->Create(WindowClass::Player, { 240, 170 }, WF_RESIZABLE); } window->Init(id); diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index a734a9f962..0c80645523 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -242,7 +242,7 @@ namespace OpenRCT2::Ui::Windows else { window = windowMgr->Create( - WindowClass::ProgressWindow, kWindowWidth, kWindowHeight, + WindowClass::ProgressWindow, { kWindowWidth, kWindowHeight }, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); } diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index b0ff13d4d8..bf7bc1b8ba 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -104,12 +104,12 @@ namespace OpenRCT2::Ui::Windows windowMgr->Close(*w); newWindow = windowMgr->Create( - WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); + WindowClass::DemolishRidePrompt, windowPos, { WW, WH }, WF_TRANSPARENT); } else { newWindow = windowMgr->Create( - WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + WindowClass::DemolishRidePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT); } newWindow->SetRide(ride); diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 50badd0d76..ad8b4e88a0 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -298,7 +298,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ResearchOpen() { auto* windowMgr = GetWindowManager(); - auto* window = windowMgr->FocusOrCreate(WindowClass::Research, WW_DEVELOPMENT, WH_DEVELOPMENT, WF_10); + auto* window = windowMgr->FocusOrCreate( + WindowClass::Research, { WW_DEVELOPMENT, WH_DEVELOPMENT }, WF_10); window->SetPage(WINDOW_RESEARCH_PAGE_DEVELOPMENT); return window; } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 1d17630306..e878316726 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -6954,7 +6954,7 @@ namespace OpenRCT2::Ui::Windows static RideWindow* WindowRideOpen(const Ride& ride) { auto* windowMgr = GetWindowManager(); - return windowMgr->Create(WindowClass::Ride, kMinimumWindowWidth, 207, WF_10 | WF_RESIZABLE, ride); + return windowMgr->Create(WindowClass::Ride, { kMinimumWindowWidth, 207 }, WF_10 | WF_RESIZABLE, ride); } /** diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 9f5375828b..455ef5994e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2842,10 +2842,10 @@ namespace OpenRCT2::Ui::Windows return ContextOpenWindowView(WV_MAZE_CONSTRUCTION); case RideConstructionWindowContext::Default: return windowMgr->Create( - WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE); } return windowMgr->Create( - WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), { WW, WH }, WF_NO_AUTO_CLOSE); } static void CloseConstructWindowOnCompletion(const Ride& ride) diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 94868ea86b..9285a1d5e7 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -1007,7 +1007,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { window = windowMgr->Create( - WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE); + WindowClass::RideList, ScreenCoordsXY(32, 32), { WW, WH }, WF_10 | WF_RESIZABLE); } return window; } diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 6884bd40b1..df8471a902 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -253,7 +253,7 @@ namespace OpenRCT2::Ui::Windows auto savePromptWindow = std::make_unique(prompt_mode); return windowMgr->Create( - std::move(savePromptWindow), WindowClass::SavePrompt, {}, width, height, + std::move(savePromptWindow), WindowClass::SavePrompt, {}, { width, height }, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 6b4684e4c5..f56a0532c8 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -934,7 +934,7 @@ namespace OpenRCT2::Ui::Windows ScreenCoordsXY screenPos = { (screenWidth - kWindowWidth) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - kWindowHeight) / 2) }; window = windowMgr->Create( - WindowClass::ScenarioSelect, screenPos, kWindowWidth, kWindowHeight, 0, callback); + WindowClass::ScenarioSelect, screenPos, { kWindowWidth, kWindowHeight }, 0, callback); return window; } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 5742f1f890..998f9a4cb7 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -203,7 +203,7 @@ namespace OpenRCT2::Ui::Windows auto* window = windowMgr->FindByClass(WindowClass::SceneryScatter); if (window == nullptr) { - window = windowMgr->Create(WindowClass::SceneryScatter, 86, 100, 0); + window = windowMgr->Create(WindowClass::SceneryScatter, { 86, 100 }, 0); } return window; diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 5c8bf05eac..b2655502f2 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -545,7 +545,7 @@ namespace OpenRCT2::Ui::Windows return window; window = windowMgr->Create( - WindowClass::ServerList, kWindowWidthMin, kWindowHeightMin, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); + WindowClass::ServerList, { kWindowWidthMin, kWindowHeightMin }, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); return window; } diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index e826540604..00ac5e2837 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -276,7 +276,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* ServerStartOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::ServerStart, WW, WH, WF_CENTRE_SCREEN); + return windowMgr->FocusOrCreate(WindowClass::ServerStart, { WW, WH }, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 86312a853e..f8e443da9d 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -83,7 +83,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); windowMgr->CloseByClass(WindowClass::ChangeKeyboardShortcut); auto* w = windowMgr->Create( - WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); + WindowClass::ChangeKeyboardShortcut, { CHANGE_WW, CHANGE_WH }, WF_CENTRE_SCREEN); if (w != nullptr) { w->_shortcutId = shortcutId; @@ -558,7 +558,7 @@ namespace OpenRCT2::Ui::Windows auto w = windowMgr->BringToFrontByClass(WindowClass::KeyboardShortcutList); if (w == nullptr) { - w = windowMgr->Create(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); + w = windowMgr->Create(WindowClass::KeyboardShortcutList, { WW, WH }, WF_RESIZABLE); } return w; } @@ -620,7 +620,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->FocusOrCreate( - WindowClass::ResetShortcutKeysPrompt, RESET_PROMPT_WW, RESET_PROMPT_WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + WindowClass::ResetShortcutKeysPrompt, { RESET_PROMPT_WW, RESET_PROMPT_WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT); } #pragma endregion } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index b6b9737538..a54d4e4058 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -336,7 +336,7 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) return w; - w = windowMgr->Create(WindowClass::Banner, WW, WH, 0); + w = windowMgr->Create(WindowClass::Banner, { WW, WH }, 0); if (w == nullptr) return nullptr; @@ -360,7 +360,7 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) return w; - w = windowMgr->Create(WindowClass::Banner, WW, WH, 0); + w = windowMgr->Create(WindowClass::Banner, { WW, WH }, 0); if (w == nullptr) return nullptr; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index d6f9eb9fc8..9caa77def0 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1227,7 +1227,7 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) return w; - w = windowMgr->Create(WindowClass::Peep, WW, WH, WF_10 | WF_RESIZABLE); + w = windowMgr->Create(WindowClass::Peep, { WW, WH }, WF_10 | WF_RESIZABLE); if (w == nullptr) return nullptr; diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index e0cd1fe8e6..8a6610ec7b 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -96,7 +96,7 @@ namespace OpenRCT2::Ui::Windows // Check if the confirm window already exists auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FocusOrCreate( - WindowClass::FirePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + WindowClass::FirePrompt, { WW, WH }, WF_CENTRE_SCREEN | WF_TRANSPARENT); window->SetWindowNumber(peep->Id.ToUnderlying()); return window; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 6578023381..e3703d4428 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -725,7 +725,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* StaffListOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); + return windowMgr->FocusOrCreate(WindowClass::StaffList, { WW, WH }, WF_10 | WF_RESIZABLE); } void WindowStaffListRefresh() diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 9b016998e6..70fca2249b 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -369,7 +369,8 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); windowMgr->CloseByClass(WindowClass::Textinput); - auto w = windowMgr->Create(WindowClass::Textinput, WW, WH + 10, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + auto w = windowMgr->Create( + WindowClass::Textinput, { WW, WH + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); if (w != nullptr) { w->SetParentWindow(call_w, call_widget); @@ -383,7 +384,8 @@ namespace OpenRCT2::Ui::Windows std::function callback, std::function cancelCallback) { auto* windowMgr = GetWindowManager(); - auto w = windowMgr->Create(WindowClass::Textinput, WW, WH + 10, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + auto w = windowMgr->Create( + WindowClass::Textinput, { WW, WH + 10 }, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); if (w != nullptr) { w->SetTitle(title, description); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 6d71ea4be7..44242b512c 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -908,7 +908,7 @@ namespace OpenRCT2::Ui::Windows if (window != nullptr) return window; - window = windowMgr->Create(WindowClass::Themes, 320, 107, WF_10 | WF_RESIZABLE); + window = windowMgr->Create(WindowClass::Themes, { 320, 107 }, WF_10 | WF_RESIZABLE); return window; } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 091fc459c5..e5d6a96677 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -2440,7 +2440,8 @@ static uint64_t PageDisabledWidgets[] = { auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->BringToFrontByClass(WindowClass::TileInspector); if (window == nullptr) - window = windowMgr->Create(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); + window = windowMgr->Create( + WindowClass::TileInspector, ScreenCoordsXY(0, 29), { WW, WH }, WF_RESIZABLE); return window; } diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 395ea35797..cd867e131f 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); return windowMgr->Create( - WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, + WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), { 40, 64 }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 37c5ed6e10..f1813fa77f 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -72,7 +72,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { window = windowMgr->Create( - WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR); + WindowClass::TitleLogo, ScreenCoordsXY(0, 0), { WW, WH }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR); } return window; } diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 1457a8e776..6ae26be5a7 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -289,7 +289,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); return windowMgr->Create( - WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), 0, windowHeight, + WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), { 0, windowHeight }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 13ca723944..ee3782ac74 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -57,7 +57,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { window = windowMgr->Create( - WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), 80, 15, + WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), { 80, 15 }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR); } diff --git a/src/openrct2-ui/windows/TitleVersion.cpp b/src/openrct2-ui/windows/TitleVersion.cpp index 9fdff57859..399d125959 100644 --- a/src/openrct2-ui/windows/TitleVersion.cpp +++ b/src/openrct2-ui/windows/TitleVersion.cpp @@ -45,7 +45,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { window = windowMgr->Create( - WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), WW, WH, + WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), { WW, WH }, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_TITLE_BAR); } return window; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 90a7be3cb1..860202115e 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -167,7 +167,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); windowMgr->Create( - std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, + std::move(tooltipWindow), WindowClass::Tooltip, windowPos, { width, height }, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_NO_TITLE_BAR); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index c5523fe7b8..e4dc752108 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1012,7 +1012,7 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); auto* window = windowMgr->Create( - WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), kTopToolbarHeight + 1, + WindowClass::TopToolbar, ScreenCoordsXY(0, 0), { ContextGetWidth(), kTopToolbarHeight + 1 }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND | WF_NO_TITLE_BAR); window->SetWidgets(_topToolbarWidgets); diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 12076a8e13..2b3d6803f4 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -103,7 +103,7 @@ namespace OpenRCT2::Ui::Windows auto trackDesignManageWindow = std::make_unique(tdFileRef); auto* window = windowMgr->Create( - std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, + std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, { WW, WH }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); return window; @@ -192,7 +192,7 @@ namespace OpenRCT2::Ui::Windows auto trackDeletePromptWindow = std::make_unique(tdFileRef); windowMgr->Create( - std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, {}, WW_DELETE_PROMPT, WH_DELETE_PROMPT, + std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, {}, { WW_DELETE_PROMPT, WH_DELETE_PROMPT }, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_AUTO_POSITION | WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index e74e5756b4..7f32175878 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -732,7 +732,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = Ui::GetWindowManager(); windowMgr->CloseConstructionWindows(); - auto* window = windowMgr->FocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); + auto* window = windowMgr->FocusOrCreate(WindowClass::TrackDesignPlace, { WW, WH }, 0); if (window != nullptr) { window->Init(std::move(openTrackDesign)); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 48588a70bb..979ce17936 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -767,7 +767,7 @@ namespace OpenRCT2::Ui::Windows screenPos = { 0, kTopToolbarHeight + 2 }; } - return windowMgr->Create(WindowClass::TrackDesignList, screenPos, WW, WH, flags, item); + return windowMgr->Create(WindowClass::TrackDesignList, screenPos, { WW, WH }, flags, item); } void WindowTrackDesignListReloadTracks() diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index e630600cb2..719d302ae9 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -246,7 +246,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); auto* window = windowMgr->BringToFrontByClass(WindowClass::Transparency); if (window == nullptr) - window = windowMgr->Create(WindowClass::Transparency, ScreenCoordsXY(32, 32), WW, WH); + window = windowMgr->Create(WindowClass::Transparency, ScreenCoordsXY(32, 32), { WW, WH }); return window; } diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 8af625fc36..bfef33206c 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -417,7 +417,7 @@ namespace OpenRCT2::Ui::Windows auto* window = windowMgr->BringToFrontByClass(WindowClass::ViewClipping); if (window == nullptr) { - window = windowMgr->Create(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), WW, WH); + window = windowMgr->Create(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), { WW, WH }); } return window; } diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 3be74a090c..cac7c249b2 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -216,6 +216,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* ViewportOpen() { - return GetWindowManager()->Create(WindowClass::Viewport, WW, WH, WF_RESIZABLE); + return GetWindowManager()->Create(WindowClass::Viewport, { WW, WH }, WF_RESIZABLE); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 0e3d2f7665..90d3dcd70c 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -425,7 +425,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* WaterOpen() { auto* windowMgr = GetWindowManager(); - return windowMgr->FocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + return windowMgr->FocusOrCreate( + WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), { WW, WH }, 0); } /** diff --git a/src/openrct2/ui/DummyWindowManager.cpp b/src/openrct2/ui/DummyWindowManager.cpp index 40ba91309f..3035b25d30 100644 --- a/src/openrct2/ui/DummyWindowManager.cpp +++ b/src/openrct2/ui/DummyWindowManager.cpp @@ -72,8 +72,7 @@ namespace OpenRCT2::Ui } WindowBase* Create( - std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, - WindowFlags flags) override + std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, ScreenSize size, WindowFlags flags) override { return nullptr; } diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index eb959f0c1b..980ae1b8ec 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -44,43 +44,40 @@ namespace OpenRCT2::Ui virtual WindowBase* GetOwner(const Viewport* viewport) = 0; virtual WindowBase* Create( - std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, - WindowFlags flags) + std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, ScreenSize size, WindowFlags flags) = 0; template::value>::type* = nullptr> - T* Create( - WindowClass cls, const ScreenCoordsXY& pos = {}, int32_t width = 0, int32_t height = 0, WindowFlags flags = 0, - TArgs&&... args) + T* Create(WindowClass cls, const ScreenCoordsXY& pos = {}, ScreenSize size = {}, WindowFlags flags = 0, TArgs&&... args) { - return static_cast(Create(std::make_unique(std::forward(args)...), cls, pos, width, height, flags)); + return static_cast(Create(std::make_unique(std::forward(args)...), cls, pos, size, flags)); } template::value>::type* = nullptr> - T* Create(WindowClass cls, int32_t width, int32_t height, WindowFlags flags, TArgs&&... args) + T* Create(WindowClass cls, ScreenSize size, WindowFlags flags, TArgs&&... args) { return static_cast( - Create(std::make_unique(std::forward(args)...), cls, {}, width, height, flags | WF_AUTO_POSITION)); + Create(std::make_unique(std::forward(args)...), cls, {}, size, flags | WF_AUTO_POSITION)); } template::value>::type* = nullptr> - T* FocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, int32_t width, int32_t height, WindowFlags flags = 0) + T* FocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, ScreenSize size, WindowFlags flags = 0) { auto* w = BringToFrontByClass(cls); if (w == nullptr) { - w = Create(cls, pos, width, height, flags); + w = Create(cls, pos, size, flags); } return static_cast(w); } template::value>::type* = nullptr> - T* FocusOrCreate(WindowClass cls, int32_t width, int32_t height, WindowFlags flags = 0) + T* FocusOrCreate(WindowClass cls, ScreenSize size, WindowFlags flags = 0) { auto* w = BringToFrontByClass(cls); if (w == nullptr) { - w = Create(cls, width, height, flags); + w = Create(cls, size, flags); } return static_cast(w); }