From 66ede938f8f7ffb483ce0e714d86287dad50d81b Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sun, 19 Jan 2025 04:01:56 +0000 Subject: [PATCH 1/8] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-ZZ.txt | 24 +++++++++++++++++++----- data/language/ko-KR.txt | 4 +++- data/language/pl-PL.txt | 4 +++- data/language/pt-BR.txt | 4 +++- data/language/ru-RU.txt | 2 ++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index c60b5efd1fe1..a0f4bef7de9c 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -2169,7 +2169,6 @@ STR_3136 :Averto: Ĉi tiu desegnaĵo estos konstruita per alternativa tipo de STR_3137 :Elekti Proksiman Pejzaĝon STR_3138 :Vakigi Elektaĵon STR_3139 :Kablolifto ne funkciiĝas kun ĉi tiu reĝimo de funkciado -STR_3140 :Kablolifto-monteto devas komenci tuj post stacio STR_3141 :Reĝimo de multaj cirkvitoj ne eblas kun kablolifto-monteto STR_3142 :{WINDOW_COLOUR_2}Kapacito: {BLACK}{STRINGID} STR_3143 :Montri homojn sur mapo @@ -2201,7 +2200,7 @@ STR_3188 :Trotuaro-Surskribaĵoj STR_3189 :Heredaĵaj trotuaroj STR_3190 :Trotuaro-Diversaĵoj STR_3191 :Pejzaĝo-Grupoj -STR_3192 :Parkeniro +STR_3192 :Parkeniroj STR_3193 :Akvo STR_3195 :Listo da Inventaĵoj STR_3196 :{WINDOW_COLOUR_2}Inventaĵo-Kategorio: {BLACK}{STRINGID} @@ -2606,7 +2605,7 @@ STR_5368 :Restarigi staton de akcidentoj STR_5371 :Elektado de objektoj STR_5372 :Inversigi trenadon per dekstra musobutono STR_5373 :Nomo {STRINGID} -STR_5374 :Dato {STRINGID} +STR_5374 :Dato modifita {STRINGID} STR_5375 :▲ STR_5376 :▼ STR_5404 :Nomo jam ekzistas @@ -3736,8 +3735,8 @@ STR_6671 :Montri ‘faktajn’ nomojn de dungitaro STR_6672 :Baskuligi inter montrado de ‘faktaj’ dungitonomoj kaj dungitonumeroj STR_6673 :Travidebla STR_6674 :{MONTH}, Jaro {COMMA16} -STR_6675 :Nomoj de Gastoj -STR_6676 :Almenaŭ unu objecto de gastonomo elektendas +STR_6675 :Nomoj de Hometoj +STR_6676 :Almenaŭ unu objecto de hometonomo elektendas STR_6677 :Aldoni strandojn ĉirkaŭ amasoj de akvo STR_6678 :Fonto de altmapo: STR_6679 :Ebenaĵo @@ -3774,3 +3773,18 @@ STR_6709 :Entajpu glatan fortecon inter {COMMA16} kaj {COMMA16} STR_6710 :Stabila ordigo STR_6711 :Dosiernomo: STR_6712 :Konservi +STR_6713 :{COMMA32} {STRINGID} +STR_6714 :Dosiernomo +STR_6715 :Dato modifita +STR_6716 :Dosiergrando +STR_6717 :Dosiergrando {STRINGID} +STR_6718 :Animacioj de Hometoj +STR_6719 :Almenaŭ unu animacio-objekto de gasto elektendas +STR_6720 :Almenaŭ unu animacio-objekto de faktoto elektendas +STR_6721 :Almenaŭ unu animacio-objekto de mekanikisto elektendas +STR_6722 :Almenaŭ unu animacio-objekto de gardisto elektendas +STR_6723 :Almenaŭ unu animacio-objekto de amuzisto elektendas +STR_6724 :Scenaro-Tekstoj +STR_6725 :X: +STR_6726 :Y: +STR_6729 :Kablolifto-monteto devas komenci tuj post stacio aŭ bremso de blokparto diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index c6663f8fdc7f..e78e1ed6fcc3 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -2173,7 +2173,6 @@ STR_3136 :경고: 다른 차량 종류로 대체되어 지어질 것이며 STR_3137 :근처 조형물 선택 STR_3138 :선택 초기화 STR_3139 :이 운행 모드에서는 케이블 리프트 힐을 작동할 수 없습니다 -STR_3140 :케이블 리프트 힐은 탑승장 바로 다음에 건설해야 합니다 STR_3141 :케이블 리프트 힐을 사용하면 2바퀴 이상 차량을 운용할 수 없습니다 STR_3142 :{WINDOW_COLOUR_2}수용량: {BLACK}{STRINGID} STR_3143 :손님을 지도에 표시합니다 @@ -3791,3 +3790,6 @@ STR_6723 :최소 하나 이상의 엔터테이너 애니메이션 오브젝 STR_6724 :시나리오 텍스트 STR_6725 :X: STR_6726 :Y: +STR_6727 :다이브 루프 (왼쪽) +STR_6728 :다이브 루프 (오른쪽) +STR_6729 :케이블 리프트 힐은 탑승장이나 블록 브레이크 바로 다음에 건설해야 합니다 diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index c9eec9dbcb3b..aac3826d8157 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -2169,7 +2169,6 @@ STR_3136 :Uwaga: Ten projekt trasy będzie wybudowany z alternatywnymi wagona STR_3137 :Wybierz najbliższą scenerię STR_3138 :Zresetuj wybór STR_3139 :Wyciągarka nie może działać w tym trybie -STR_3140 :Wyciągarka musi znajdować się na początku trasy STR_3141 :Wielokrotne pętle nie są dostępne w parze z wyciągarką STR_3142 :{WINDOW_COLOUR_2}Pojemność: {BLACK}{STRINGID} STR_3143 :Pokaż ludzi @@ -3788,3 +3787,6 @@ STR_6723 :Należy wybrać co najmniej jeden obiekt animacji komika STR_6724 :Teksty scenariuszy STR_6725 :X: STR_6726 :Y: +STR_6727 :Pętla nurkująca (w lewo) +STR_6728 :Pętla nurkująca (w prawo) +STR_6729 :Wyciągarka linowa musi znajdować się bezpośrednio po stacji lub hamulcu blokowym diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 5ce468928b12..c99883a3de7a 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -2169,7 +2169,6 @@ STR_3136 :Aviso: Este projeto será construído com um tipo alternativo de ve STR_3137 :Selecionar Cenários Próximos STR_3138 :Reiniciar Seleção STR_3139 :Cabo de elevação não funciona neste modo de operação -STR_3140 :Cabo de elevação deve estar imediatamente após a estação STR_3141 :Várias voltas por ingresso não são possíveis com o cabo de elevação STR_3142 :{WINDOW_COLOUR_2}Capacidade: {BLACK}{STRINGID} STR_3143 :Mostrar pessoas no mapa @@ -3788,3 +3787,6 @@ STR_6723 :Ao menos um objeto de animação de pessoinha de animador deve ser STR_6724 :Textos dos Cenários STR_6725 :X: STR_6726 :Y: +STR_6727 :Loop em mergulho (esquerda) +STR_6728 :Loop em mergulho (direita) +STR_6729 :Cabo de elevação deve estar imediatamente após a estação ou freio bloqueador diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index 3897aa824150..6aa852f576c3 100644 --- a/data/language/ru-RU.txt +++ b/data/language/ru-RU.txt @@ -3776,3 +3776,5 @@ STR_6724 :Тексты сценариев STR_6725 :X: STR_6726 :Y: STR_6729 :Кабельный лифт должен начинаться сразу после станции или блок-тормоза +STR_6727 :Петля со спуском (левая) +STR_6728 :Петля со спуском (правая) From bed4d5bdcabbccf41559e5c22da9b232f7af768e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 19 Jan 2025 10:58:28 +0100 Subject: [PATCH 2/8] Move WindowCreate and WindowFocusOrCreate into WindowManager (#23643) * Move WindowBringToFront into WindowManager * Move WindowCreate and WindowFocusOrCreate into WindowManager * Cut back on Context/UiContext includes --- src/openrct2-ui/ProvisionalElements.cpp | 4 +- src/openrct2-ui/WindowManager.cpp | 345 +++++++++++++++++- src/openrct2-ui/input/InputManager.cpp | 4 +- src/openrct2-ui/input/MouseInput.cpp | 34 +- src/openrct2-ui/input/Shortcuts.cpp | 34 +- .../interface/ViewportInteraction.cpp | 8 +- src/openrct2-ui/interface/ViewportQuery.cpp | 4 +- src/openrct2-ui/interface/Window.cpp | 269 +------------- src/openrct2-ui/interface/Window.h | 36 -- src/openrct2-ui/scripting/CustomMenu.cpp | 2 +- src/openrct2-ui/scripting/CustomWindow.cpp | 8 +- src/openrct2-ui/scripting/ScViewport.hpp | 2 +- src/openrct2-ui/scripting/ScWidget.hpp | 2 +- src/openrct2-ui/scripting/ScWindow.hpp | 7 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/About.cpp | 5 +- src/openrct2-ui/windows/AssetPacks.cpp | 5 +- src/openrct2-ui/windows/Banner.cpp | 6 +- src/openrct2-ui/windows/Changelog.cpp | 7 +- src/openrct2-ui/windows/Cheats.cpp | 6 +- src/openrct2-ui/windows/ClearScenery.cpp | 6 +- src/openrct2-ui/windows/CustomCurrency.cpp | 4 +- src/openrct2-ui/windows/DebugPaint.cpp | 4 +- .../windows/DemolishRidePrompt.cpp | 13 +- src/openrct2-ui/windows/Dropdown.cpp | 7 +- .../windows/EditorBottomToolbar.cpp | 4 +- .../windows/EditorInventionsList.cpp | 16 +- .../windows/EditorObjectSelection.cpp | 6 +- .../windows/EditorObjectiveOptions.cpp | 6 +- .../windows/EditorParkEntrance.cpp | 8 +- .../windows/EditorScenarioOptions.cpp | 5 +- src/openrct2-ui/windows/Error.cpp | 5 +- src/openrct2-ui/windows/Finances.cpp | 8 +- src/openrct2-ui/windows/Footpath.cpp | 20 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 4 +- src/openrct2-ui/windows/Guest.cpp | 8 +- src/openrct2-ui/windows/GuestList.cpp | 8 +- src/openrct2-ui/windows/InstallTrack.cpp | 4 +- src/openrct2-ui/windows/Land.cpp | 6 +- src/openrct2-ui/windows/LandRights.cpp | 4 +- src/openrct2-ui/windows/LoadSave.cpp | 10 +- src/openrct2-ui/windows/Main.cpp | 4 +- src/openrct2-ui/windows/Map.cpp | 15 +- src/openrct2-ui/windows/MapGen.cpp | 4 +- src/openrct2-ui/windows/MapTooltip.cpp | 7 +- src/openrct2-ui/windows/MazeConstruction.cpp | 6 +- src/openrct2-ui/windows/Multiplayer.cpp | 6 +- src/openrct2-ui/windows/NetworkStatus.cpp | 13 +- src/openrct2-ui/windows/NewCampaign.cpp | 9 +- src/openrct2-ui/windows/NewRide.cpp | 11 +- src/openrct2-ui/windows/News.cpp | 4 +- src/openrct2-ui/windows/NewsOptions.cpp | 4 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 7 +- src/openrct2-ui/windows/Options.cpp | 8 +- src/openrct2-ui/windows/Park.cpp | 8 +- src/openrct2-ui/windows/PatrolArea.cpp | 8 +- src/openrct2-ui/windows/Player.cpp | 6 +- src/openrct2-ui/windows/ProgressWindow.cpp | 11 +- .../windows/RefurbishRidePrompt.cpp | 8 +- src/openrct2-ui/windows/Research.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 22 +- src/openrct2-ui/windows/RideConstruction.cpp | 45 +-- src/openrct2-ui/windows/RideList.cpp | 7 +- src/openrct2-ui/windows/SavePrompt.cpp | 7 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 6 +- src/openrct2-ui/windows/Scenery.cpp | 29 +- src/openrct2-ui/windows/SceneryScatter.cpp | 6 +- src/openrct2-ui/windows/ServerList.cpp | 6 +- src/openrct2-ui/windows/ServerStart.cpp | 4 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 16 +- src/openrct2-ui/windows/Sign.cpp | 11 +- src/openrct2-ui/windows/Staff.cpp | 9 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 4 +- src/openrct2-ui/windows/StaffList.cpp | 8 +- src/openrct2-ui/windows/TextInput.cpp | 11 +- src/openrct2-ui/windows/Themes.cpp | 10 +- src/openrct2-ui/windows/TileInspector.cpp | 10 +- src/openrct2-ui/windows/TitleExit.cpp | 4 +- src/openrct2-ui/windows/TitleLogo.cpp | 6 +- src/openrct2-ui/windows/TitleMenu.cpp | 13 +- src/openrct2-ui/windows/TitleOptions.cpp | 6 +- src/openrct2-ui/windows/TitleVersion.cpp | 6 +- src/openrct2-ui/windows/Tooltip.cpp | 5 +- src/openrct2-ui/windows/TopToolbar.cpp | 12 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 9 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 12 +- src/openrct2-ui/windows/TrackList.cpp | 8 +- src/openrct2-ui/windows/Transparency.cpp | 7 +- src/openrct2-ui/windows/ViewClipping.cpp | 6 +- src/openrct2-ui/windows/Viewport.cpp | 5 +- src/openrct2-ui/windows/Water.cpp | 6 +- src/openrct2/Context.cpp | 20 +- src/openrct2/Editor.cpp | 4 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/ParkMarketingAction.cpp | 2 +- src/openrct2/actions/ParkSetLoanAction.cpp | 2 +- .../actions/ParkSetResearchFundingAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 2 +- src/openrct2/actions/RideSetNameAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 4 +- src/openrct2/entity/Guest.cpp | 4 +- src/openrct2/entity/Peep.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 8 +- src/openrct2/interface/Window.cpp | 95 +---- src/openrct2/interface/Window.h | 5 - src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/paint/Painter.cpp | 2 +- src/openrct2/ride/Ride.cpp | 16 +- src/openrct2/ride/RideConstruction.cpp | 6 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ui/DummyWindowManager.cpp | 25 ++ src/openrct2/ui/WindowManager.h | 48 +++ src/openrct2/world/TileInspector.cpp | 2 +- 113 files changed, 895 insertions(+), 767 deletions(-) diff --git a/src/openrct2-ui/ProvisionalElements.cpp b/src/openrct2-ui/ProvisionalElements.cpp index 3fa1161dd032..0d16339bdc00 100644 --- a/src/openrct2-ui/ProvisionalElements.cpp +++ b/src/openrct2-ui/ProvisionalElements.cpp @@ -30,7 +30,7 @@ namespace OpenRCT2::Ui FootpathRemoveProvisionalTemporarily(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::RideConstruction) != nullptr) { RideRemoveProvisionalTrackPiece(); @@ -50,7 +50,7 @@ namespace OpenRCT2::Ui FootpathRestoreProvisional(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::RideConstruction) != nullptr) { RideRestoreProvisionalTrackPiece(); diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index ae8f33e83926..6f1068b2399e 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -19,7 +19,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -30,6 +32,7 @@ #include #include #include +#include #include using namespace OpenRCT2; @@ -323,7 +326,7 @@ class WindowManager final : public IWindowManager case INTENT_ACTION_NEW_SCENERY: { // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::Scenery); + auto* window = BringToFrontByClass(WindowClass::Scenery); if (window == nullptr) ToggleSceneryWindow(); @@ -647,6 +650,270 @@ class WindowManager final : public IWindowManager return nullptr; } + static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, int32_t width, int32_t height) + { + for (auto& w : g_window_list) + { + if (w->flags & WF_DEAD) + continue; + if (w->flags & WF_STICK_TO_BACK) + continue; + + if (loc.x + width <= w->windowPos.x) + continue; + if (loc.x >= w->windowPos.x + w->width) + continue; + if (loc.y + height <= w->windowPos.y) + continue; + if (loc.y >= w->windowPos.y + w->height) + continue; + return false; + } + + return true; + } + + static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, int32_t width, int32_t height) + { + if (loc.x < 0) + return false; + if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + return false; + if (loc.x + width > ContextGetWidth()) + return false; + if (loc.y + height > ContextGetHeight()) + return false; + return WindowFitsBetweenOthers(loc, width, height); + } + + static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, int32_t width, int32_t height) + { + uint16_t screenWidth = ContextGetWidth(); + uint16_t screenHeight = ContextGetHeight(); + int32_t unk; + + unk = -(width / 4); + if (loc.x < unk) + return false; + unk = screenWidth + (unk * 2); + if (loc.x > unk) + return false; + if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + return false; + unk = screenHeight - (height / 4); + if (loc.y > unk) + return false; + return WindowFitsBetweenOthers(loc, width, height); + } + + static ScreenCoordsXY ClampWindowToScreen( + const ScreenCoordsXY& pos, const int32_t screenWidth, const int32_t screenHeight, const int32_t width, + const int32_t height) + { + auto screenPos = pos; + if (width > screenWidth || screenPos.x < 0) + screenPos.x = 0; + else if (screenPos.x + width > screenWidth) + screenPos.x = screenWidth - width; + + auto toolbarAllowance = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 0 : (kTopToolbarHeight + 1); + if (height - toolbarAllowance > screenHeight || screenPos.y < toolbarAllowance) + screenPos.y = toolbarAllowance; + else if (screenPos.y + height - toolbarAllowance > screenHeight) + screenPos.y = screenHeight + toolbarAllowance - height; + + return screenPos; + } + + static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) + { + auto uiContext = GetContext()->GetUiContext(); + auto screenWidth = uiContext->GetWidth(); + auto screenHeight = 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 + }; + + for (const auto& cornerPos : cornerPositions) + { + if (WindowFitsWithinSpace(cornerPos, width, height)) + { + return ClampWindowToScreen(cornerPos, screenWidth, screenHeight, width, height); + } + } + + // Place window next to another + for (auto& w : g_window_list) + { + if (w->flags & WF_DEAD) + continue; + if (w->flags & WF_STICK_TO_BACK) + continue; + + const ScreenCoordsXY offsets[] = { + { w->width + 2, 0 }, + { -w->width - 2, 0 }, + { 0, w->height + 2 }, + { 0, -w->height - 2 }, + { w->width + 2, -w->height - 2 }, + { -w->width - 2, -w->height - 2 }, + { w->width + 2, w->height + 2 }, + { -w->width - 2, w->height + 2 }, + }; + + for (const auto& offset : offsets) + { + auto screenPos = w->windowPos + offset; + if (WindowFitsWithinSpace(screenPos, width, height)) + { + return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + } + } + } + + // Overlap + for (auto& w : g_window_list) + { + if (w->flags & WF_DEAD) + continue; + if (w->flags & WF_STICK_TO_BACK) + continue; + + const ScreenCoordsXY offsets[] = { + { w->width + 2, 0 }, + { -w->width - 2, 0 }, + { 0, w->height + 2 }, + { 0, -w->height - 2 }, + }; + + for (const auto& offset : offsets) + { + auto screenPos = w->windowPos + offset; + if (WindowFitsOnScreen(screenPos, width, height)) + { + return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + } + } + } + + // Cascade + auto screenPos = ScreenCoordsXY{ 0, 30 }; + for (auto& w : g_window_list) + { + if (screenPos == w->windowPos) + { + screenPos.x += 5; + screenPos.y += 5; + } + } + + return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); + } + + static ScreenCoordsXY GetCentrePositionForNewWindow(int32_t width, int32_t height) + { + auto uiContext = GetContext()->GetUiContext(); + auto screenWidth = uiContext->GetWidth(); + auto screenHeight = uiContext->GetHeight(); + return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - height) / 2) }; + } + + WindowBase* Create( + std::unique_ptr&& wp, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, + uint32_t flags) override + { + if (flags & WF_AUTO_POSITION) + { + if (flags & WF_CENTRE_SCREEN) + { + pos = GetCentrePositionForNewWindow(width, height); + } + else + { + pos = GetAutoPositionForNewWindow(width, height); + } + } + + // 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. + if (g_window_list.size() >= static_cast(Config::Get().general.WindowLimit + kWindowLimitReserved)) + { + // Close least recently used window + for (auto& w : g_window_list) + { + if (w->flags & WF_DEAD) + continue; + if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) + { + WindowClose(*w.get()); + break; + } + } + } + + // Find right position to insert new window + auto itDestPos = g_window_list.end(); + if (flags & WF_STICK_TO_BACK) + { + for (auto it = g_window_list.begin(); it != g_window_list.end(); it++) + { + if ((*it)->flags & WF_DEAD) + continue; + if (!((*it)->flags & WF_STICK_TO_BACK)) + { + itDestPos = it; + } + } + } + else if (!(flags & WF_STICK_TO_FRONT)) + { + for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) + { + if ((*it)->flags & WF_DEAD) + continue; + if (!((*it)->flags & WF_STICK_TO_FRONT)) + { + itDestPos = it.base(); + break; + } + } + } + + auto itNew = g_window_list.insert(itDestPos, std::move(wp)); + auto w = itNew->get(); + + // Setup window + w->classification = cls; + w->flags = flags; + + // Play sounds and flash the window + 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)); + } + + 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->focus = std::nullopt; + + ColourSchemeUpdate(w); + w->Invalidate(); + w->OnOpen(); + return w; + } + /** * Finds the first window with the specified window class. * rct2: 0x006EA8A0 @@ -762,6 +1029,82 @@ class WindowManager final : public IWindowManager // Return the widget index return widget_index; } + + /** + * + * rct2: 0x006ECDA4 + */ + WindowBase* BringToFront(WindowBase& w) override + { + if (!(w.flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) + { + auto itSourcePos = WindowGetIterator(&w); + if (itSourcePos != g_window_list.end()) + { + // Insert in front of the first non-stick-to-front window + auto itDestPos = g_window_list.begin(); + for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) + { + auto& w2 = *it; + if (!(w2->flags & WF_STICK_TO_FRONT)) + { + itDestPos = it.base(); + break; + } + } + + g_window_list.splice(itDestPos, g_window_list, itSourcePos); + w.Invalidate(); + + if (w.windowPos.x + w.width < 20) + { + int32_t i = 20 - w.windowPos.x; + w.windowPos.x += i; + if (w.viewport != nullptr) + w.viewport->pos.x += i; + w.Invalidate(); + } + } + } + return &w; + } + + WindowBase* BringToFrontByClassWithFlags(WindowClass cls, uint16_t flags) override + { + WindowBase* w = FindByClass(cls); + if (w != nullptr) + { + w->flags |= flags; + w->Invalidate(); + w = BringToFront(*w); + } + + return w; + } + + WindowBase* BringToFrontByClass(WindowClass cls) override + { + return BringToFrontByClassWithFlags(cls, WF_WHITE_BORDER_MASK); + } + + /** + * + * rct2: 0x006ED78A + * cls (cl) + * number (dx) + */ + WindowBase* BringToFrontByNumber(WindowClass cls, rct_windownumber number) override + { + WindowBase* w = FindByNumber(cls, number); + if (w != nullptr) + { + w->flags |= WF_WHITE_BORDER_MASK; + w->Invalidate(); + w = BringToFront(*w); + } + + return w; + } }; std::unique_ptr OpenRCT2::Ui::CreateWindowManager() diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index c76d9ed3644c..0ec239cabee4 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -210,7 +210,7 @@ void InputManager::Process(const InputEvent& e) if (e.DeviceKind == InputDeviceKind::Keyboard) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); // TODO: replace with event auto w = windowMgr->FindByClass(WindowClass::Textinput); @@ -424,7 +424,7 @@ bool InputManager::HasTextInputFocus() const if (OpenRCT2::Ui::Windows::IsUsingWidgetTextBox() || gChatOpen) return true; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::Textinput); if (w != nullptr) return true; diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 2821567c0baf..49fef8388e24 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -246,7 +246,7 @@ namespace OpenRCT2 */ static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState state) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { @@ -286,7 +286,7 @@ namespace OpenRCT2 Widget* widget; WidgetIndex widgetIndex; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); // Get window and widget under cursor position w = windowMgr->FindFromPoint(screenCoords); @@ -312,7 +312,7 @@ namespace OpenRCT2 if (w != nullptr) { - w = WindowBringToFront(*w); + w = windowMgr->BringToFront(*w); } if (widgetIndex != kWidgetIndexNull) @@ -566,7 +566,7 @@ namespace OpenRCT2 if (differentialCoords.x == 0 && differentialCoords.y == 0) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); // #3294: Window can be closed during a drag session, so just finish @@ -776,7 +776,7 @@ namespace OpenRCT2 const auto& widget = w.widgets[widgetIndex]; auto& scroll = w.scrolls[scroll_id]; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { int32_t newLeft; @@ -816,7 +816,7 @@ namespace OpenRCT2 const auto& widget = w.widgets[widgetIndex]; auto& scroll = w.scrolls[scroll_id]; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { int32_t newTop; @@ -853,7 +853,7 @@ namespace OpenRCT2 */ static void InputScrollPartUpdateHLeft(WindowBase& w, WidgetIndex widgetIndex, int32_t scroll_id) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; @@ -873,7 +873,7 @@ namespace OpenRCT2 { const auto& widget = w.widgets[widgetIndex]; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; @@ -899,7 +899,7 @@ namespace OpenRCT2 */ static void InputScrollPartUpdateVTop(WindowBase& w, WidgetIndex widgetIndex, int32_t scroll_id) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; @@ -919,7 +919,7 @@ namespace OpenRCT2 { const auto& widget = w.widgets[widgetIndex]; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) { auto& scroll = w.scrolls[scroll_id]; @@ -1016,7 +1016,7 @@ namespace OpenRCT2 */ static void InputWidgetOverFlatbuttonInvalidate() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number); if (w != nullptr) { @@ -1048,12 +1048,12 @@ namespace OpenRCT2 WindowCloseByClass(WindowClass::Tooltip); // Window might have changed position in the list, therefore find it again - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); w = windowMgr->FindByNumber(windowClass, windowNumber); if (w == nullptr) return; - w = WindowBringToFront(*w); + w = windowMgr->BringToFront(*w); if (widgetIndex == kWidgetIndexNull) return; @@ -1145,7 +1145,7 @@ namespace OpenRCT2 ft.Add(STR_NONE); SetMapTooltip(ft); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindFromPoint(screenCoords); if (window != nullptr) @@ -1223,7 +1223,7 @@ namespace OpenRCT2 { if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w == nullptr) @@ -1305,7 +1305,7 @@ namespace OpenRCT2 cursor_w_number = gPressedWidget.window_number; WidgetIndex cursor_widgetIndex = gPressedWidget.widget_index; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* cursor_w = windowMgr->FindByNumber(cursor_w_class, cursor_w_number); if (cursor_w == nullptr) { @@ -1612,7 +1612,7 @@ namespace OpenRCT2 */ void InvalidateScroll() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(gPressedWidget.window_classification, gPressedWidget.window_number); if (w != nullptr) { diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 136e2dac9a46..4f7e51738f98 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -89,7 +89,7 @@ static void ShortcutRotateConstructionObject() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); // Rotate scenery WindowBase* w = windowMgr->FindByClass(WindowClass::Scenery); @@ -152,7 +152,7 @@ static void ShortcutRotateConstructionObject() static void ShortcutRemoveTopBottomToolbarToggle() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) { @@ -372,7 +372,7 @@ static void ShortcutOpenCheatWindow() return; // Check if window is already open - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Cheats); if (window != nullptr) { @@ -441,7 +441,7 @@ static void ShortcutOpenSceneryPicker() || (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && GetGameState().EditorStep != EditorStep::LandscapeEditor)) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window_scenery = windowMgr->FindByClass(WindowClass::Scenery); if (window_scenery == nullptr) ToggleSceneryWindow(); @@ -477,7 +477,7 @@ static void ShortcutScaleDown() // Tile inspector shortcuts static void TileInspectorMouseUp(WidgetIndex widgetIndex) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { @@ -487,7 +487,7 @@ static void TileInspectorMouseUp(WidgetIndex widgetIndex) static void TileInspectorMouseDown(WidgetIndex widgetIndex) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { @@ -497,7 +497,7 @@ static void TileInspectorMouseDown(WidgetIndex widgetIndex) static void ShortcutToggleWallSlope() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::TileInspector); if (window == nullptr) { @@ -529,7 +529,7 @@ static void ShortcutToggleWallSlope() static void ShortcutIncreaseElementHeight() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::TileInspector); if (w != nullptr) { @@ -569,7 +569,7 @@ static void ShortcutIncreaseElementHeight() static void ShortcutDecreaseElementHeight() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::TileInspector); if (w != nullptr) { @@ -633,7 +633,7 @@ static void ShortcutConstructionTurnLeft() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -650,7 +650,7 @@ static void ShortcutConstructionTurnRight() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -667,7 +667,7 @@ static void ShortcutConstructionSlopeUp() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -684,7 +684,7 @@ static void ShortcutConstructionBuildCurrent() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -701,7 +701,7 @@ static void ShortcutConstructionSlopeDown() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -718,7 +718,7 @@ static void ShortcutConstructionDemolishCurrent() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindByClass(WindowClass::Footpath); if (window != nullptr) { @@ -763,7 +763,7 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::kInterfaceCancelConstruction, STR_SHORTCUT_CANCEL_CONSTRUCTION_MODE, "ESCAPE", []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = windowMgr->FindByClass(WindowClass::Error); if (window != nullptr) { @@ -900,7 +900,7 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::kDebugTogglePaintDebugWindow, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = windowMgr->FindByClass(WindowClass::DebugPaint); if (window != nullptr) { diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index d8475d5f79c3..e8dd7577e67b 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -469,7 +469,7 @@ namespace OpenRCT2::Ui if (!(InputTestFlag(INPUT_FLAG_6)) || !(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::RideConstruction) == nullptr && windowMgr->FindByClass(WindowClass::Footpath) == nullptr) { @@ -637,7 +637,7 @@ namespace OpenRCT2::Ui */ static void ViewportInteractionRemoveFootpath(const PathElement& pathElement, const CoordsXY& mapCoords) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) FootpathUpdateProvisional(); @@ -765,7 +765,7 @@ namespace OpenRCT2::Ui static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindFromPoint(screenCoords); if (w == nullptr) return nullptr; @@ -790,7 +790,7 @@ namespace OpenRCT2::Ui */ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { diff --git a/src/openrct2-ui/interface/ViewportQuery.cpp b/src/openrct2-ui/interface/ViewportQuery.cpp index 3b485c43dfcb..5b56b3e3f307 100644 --- a/src/openrct2-ui/interface/ViewportQuery.cpp +++ b/src/openrct2-ui/interface/ViewportQuery.cpp @@ -39,7 +39,7 @@ namespace OpenRCT2::Ui */ CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { @@ -138,7 +138,7 @@ namespace OpenRCT2::Ui 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. - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* window = windowMgr->FindFromPoint(screenCoords); if (window == nullptr || window->viewport == nullptr) { diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index c22f6ecb4ee0..970a8408f6bd 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -41,179 +41,6 @@ namespace OpenRCT2 static int32_t _previousAbsoluteWheel = 0; - static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, int32_t width, int32_t height) - { - for (auto& w : g_window_list) - { - if (w->flags & WF_DEAD) - continue; - if (w->flags & WF_STICK_TO_BACK) - continue; - - if (loc.x + width <= w->windowPos.x) - continue; - if (loc.x >= w->windowPos.x + w->width) - continue; - if (loc.y + height <= w->windowPos.y) - continue; - if (loc.y >= w->windowPos.y + w->height) - continue; - return false; - } - - return true; - } - - static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, int32_t width, int32_t height) - { - if (loc.x < 0) - return false; - if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) - return false; - if (loc.x + width > ContextGetWidth()) - return false; - if (loc.y + height > ContextGetHeight()) - return false; - return WindowFitsBetweenOthers(loc, width, height); - } - - static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, int32_t width, int32_t height) - { - uint16_t screenWidth = ContextGetWidth(); - uint16_t screenHeight = ContextGetHeight(); - int32_t unk; - - unk = -(width / 4); - if (loc.x < unk) - return false; - unk = screenWidth + (unk * 2); - if (loc.x > unk) - return false; - if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) - return false; - unk = screenHeight - (height / 4); - if (loc.y > unk) - return false; - return WindowFitsBetweenOthers(loc, width, height); - } - - static ScreenCoordsXY ClampWindowToScreen( - const ScreenCoordsXY& pos, const int32_t screenWidth, const int32_t screenHeight, const int32_t width, - const int32_t height) - { - auto screenPos = pos; - if (width > screenWidth || screenPos.x < 0) - screenPos.x = 0; - else if (screenPos.x + width > screenWidth) - screenPos.x = screenWidth - width; - - auto toolbarAllowance = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 0 : (kTopToolbarHeight + 1); - if (height - toolbarAllowance > screenHeight || screenPos.y < toolbarAllowance) - screenPos.y = toolbarAllowance; - else if (screenPos.y + height - toolbarAllowance > screenHeight) - screenPos.y = screenHeight + toolbarAllowance - height; - - return screenPos; - } - - static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) - { - auto uiContext = GetContext()->GetUiContext(); - auto screenWidth = uiContext->GetWidth(); - auto screenHeight = 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 - }; - - for (const auto& cornerPos : cornerPositions) - { - if (WindowFitsWithinSpace(cornerPos, width, height)) - { - return ClampWindowToScreen(cornerPos, screenWidth, screenHeight, width, height); - } - } - - // Place window next to another - for (auto& w : g_window_list) - { - if (w->flags & WF_DEAD) - continue; - if (w->flags & WF_STICK_TO_BACK) - continue; - - const ScreenCoordsXY offsets[] = { - { w->width + 2, 0 }, - { -w->width - 2, 0 }, - { 0, w->height + 2 }, - { 0, -w->height - 2 }, - { w->width + 2, -w->height - 2 }, - { -w->width - 2, -w->height - 2 }, - { w->width + 2, w->height + 2 }, - { -w->width - 2, w->height + 2 }, - }; - - for (const auto& offset : offsets) - { - auto screenPos = w->windowPos + offset; - if (WindowFitsWithinSpace(screenPos, width, height)) - { - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); - } - } - } - - // Overlap - for (auto& w : g_window_list) - { - if (w->flags & WF_DEAD) - continue; - if (w->flags & WF_STICK_TO_BACK) - continue; - - const ScreenCoordsXY offsets[] = { - { w->width + 2, 0 }, - { -w->width - 2, 0 }, - { 0, w->height + 2 }, - { 0, -w->height - 2 }, - }; - - for (const auto& offset : offsets) - { - auto screenPos = w->windowPos + offset; - if (WindowFitsOnScreen(screenPos, width, height)) - { - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); - } - } - } - - // Cascade - auto screenPos = ScreenCoordsXY{ 0, 30 }; - for (auto& w : g_window_list) - { - if (screenPos == w->windowPos) - { - screenPos.x += 5; - screenPos.y += 5; - } - } - - return ClampWindowToScreen(screenPos, screenWidth, screenHeight, width, height); - } - - static ScreenCoordsXY GetCentrePositionForNewWindow(int32_t width, int32_t height) - { - auto uiContext = GetContext()->GetUiContext(); - auto screenWidth = uiContext->GetWidth(); - auto screenHeight = uiContext->GetHeight(); - return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - height) / 2) }; - } - static int32_t WindowGetWidgetIndex(const WindowBase& w, Widget* widget) { const auto it = std::find_if( @@ -441,7 +268,7 @@ namespace OpenRCT2 // Check window cursor is over if (!(InputTestFlag(INPUT_FLAG_5))) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindFromPoint(cursorState->position); if (w != nullptr) { @@ -734,96 +561,6 @@ namespace OpenRCT2::Ui::Windows static TextInputSession* _textInput; static WidgetIdentifier _currentTextBox = { { WindowClass::Null, 0 }, 0 }; - WindowBase* WindowCreate( - std::unique_ptr&& wp, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags) - { - if (flags & WF_AUTO_POSITION) - { - if (flags & WF_CENTRE_SCREEN) - { - pos = GetCentrePositionForNewWindow(width, height); - } - else - { - pos = GetAutoPositionForNewWindow(width, height); - } - } - - // 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. - if (g_window_list.size() >= static_cast(Config::Get().general.WindowLimit + kWindowLimitReserved)) - { - // Close least recently used window - for (auto& w : g_window_list) - { - if (w->flags & WF_DEAD) - continue; - if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) - { - WindowClose(*w.get()); - break; - } - } - } - - // Find right position to insert new window - auto itDestPos = g_window_list.end(); - if (flags & WF_STICK_TO_BACK) - { - for (auto it = g_window_list.begin(); it != g_window_list.end(); it++) - { - if ((*it)->flags & WF_DEAD) - continue; - if (!((*it)->flags & WF_STICK_TO_BACK)) - { - itDestPos = it; - } - } - } - else if (!(flags & WF_STICK_TO_FRONT)) - { - for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) - { - if ((*it)->flags & WF_DEAD) - continue; - if (!((*it)->flags & WF_STICK_TO_FRONT)) - { - itDestPos = it.base(); - break; - } - } - } - - auto itNew = g_window_list.insert(itDestPos, std::move(wp)); - auto w = itNew->get(); - - // Setup window - w->classification = cls; - w->flags = flags; - - // Play sounds and flash the window - 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)); - } - - 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->focus = std::nullopt; - - ColourSchemeUpdate(w); - w->Invalidate(); - w->OnOpen(); - return w; - } - WindowBase* WindowGetListening() { for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) @@ -871,7 +608,7 @@ namespace OpenRCT2::Ui::Windows { if (_usingWidgetTextBox) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(_currentTextBox.window.classification, _currentTextBox.window.number); _currentTextBox.window.classification = WindowClass::Null; _currentTextBox.window.number = 0; @@ -897,7 +634,7 @@ namespace OpenRCT2::Ui::Windows if (_usingWidgetTextBox) { _textBoxFrameNo = 0; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(_currentTextBox.window.classification, _currentTextBox.window.number); WidgetInvalidate(*w, _currentTextBox.widget_index); w->OnTextInput(_currentTextBox.widget_index, _textBoxInput); diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index d5003c07c05f..107610f47df3 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -55,42 +55,6 @@ namespace OpenRCT2 namespace OpenRCT2::Ui::Windows { - WindowBase* WindowCreate( - std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags); - template::value>::type* = nullptr> - T* WindowCreate( - WindowClass cls, const ScreenCoordsXY& pos = {}, int32_t width = 0, int32_t height = 0, uint32_t flags = 0, - TArgs&&... args) - { - return static_cast(WindowCreate(std::make_unique(std::forward(args)...), cls, pos, width, height, flags)); - } - template::value>::type* = nullptr> - T* WindowCreate(WindowClass cls, int32_t width, int32_t height, uint32_t flags, TArgs&&... args) - { - return static_cast( - WindowCreate(std::make_unique(std::forward(args)...), cls, {}, width, height, flags | WF_AUTO_POSITION)); - } - template::value>::type* = nullptr> - T* WindowFocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, int32_t width, int32_t height, uint32_t flags = 0) - { - auto* w = WindowBringToFrontByClass(cls); - if (w == nullptr) - { - w = WindowCreate(cls, pos, width, height, flags); - } - return static_cast(w); - } - template::value>::type* = nullptr> - T* WindowFocusOrCreate(WindowClass cls, int32_t width, int32_t height, uint32_t flags = 0) - { - auto* w = WindowBringToFrontByClass(cls); - if (w == nullptr) - { - w = WindowCreate(cls, width, height, flags); - } - return static_cast(w); - } - void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index 6b0548b0cc58..d085254a9962 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -268,7 +268,7 @@ namespace OpenRCT2::Scripting customTool.onUp = dukValue["onUp"]; customTool.onFinish = dukValue["onFinish"]; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto toolbarWindow = windowMgr->FindByClass(WindowClass::TopToolbar); if (toolbarWindow != nullptr) { diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index c89f8ce91cfe..b1dffc6b3ef2 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -1111,7 +1111,7 @@ namespace OpenRCT2::Ui::Windows static rct_windownumber GetNewWindowNumber() { auto result = _nextWindowNumber++; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); while (windowMgr->FindByNumber(WindowClass::Custom, result) != nullptr) { result++; @@ -1126,15 +1126,17 @@ namespace OpenRCT2::Ui::Windows { auto desc = CustomWindowDesc::FromDukValue(dukDesc); uint16_t windowFlags = WF_RESIZABLE | WF_TRANSPARENT; + auto* windowMgr = GetWindowManager(); + CustomWindow* window{}; if (desc.X && desc.Y) { - window = WindowCreate( + window = windowMgr->Create( WindowClass::Custom, { *desc.X, *desc.Y }, desc.Width, desc.Height, windowFlags, owner, desc); } else { - window = WindowCreate(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/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 0f81cccc019c..c0910bd8919d 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -253,7 +253,7 @@ namespace OpenRCT2::Scripting if (_class == WindowClass::MainWindow) return WindowGetMain(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); return windowMgr->FindByNumber(_class, _number); } diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index aeb056e5319f..46478fd8d05d 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -393,7 +393,7 @@ namespace OpenRCT2::Scripting if (_class == WindowClass::MainWindow) return WindowGetMain(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); return windowMgr->FindByNumber(_class, _number); } diff --git a/src/openrct2-ui/scripting/ScWindow.hpp b/src/openrct2-ui/scripting/ScWindow.hpp index 872ac02bd2f3..2d973a81bb74 100644 --- a/src/openrct2-ui/scripting/ScWindow.hpp +++ b/src/openrct2-ui/scripting/ScWindow.hpp @@ -326,10 +326,11 @@ namespace OpenRCT2::Scripting void bringToFront() { - auto w = GetWindow(); + auto* w = GetWindow(); if (w != nullptr) { - WindowBringToFront(*w); + auto* windowMgr = Ui::GetWindowManager(); + w = windowMgr->BringToFront(*w); w->flags |= WF_WHITE_BORDER_MASK; } } @@ -360,7 +361,7 @@ namespace OpenRCT2::Scripting private: WindowBase* GetWindow() const { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); return windowMgr->FindByNumber(_class, _number); } }; diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 9ffe18772785..f4da02696f8b 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -430,7 +430,7 @@ namespace OpenRCT2::Title void PrepareParkForPlayback() { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); auto& gameState = GetGameState(); windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation); ResetEntitySpatialIndices(); diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 70c771dd6173..4e1c58483fbf 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -280,6 +280,7 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* AboutOpen() { - return WindowFocusOrCreate(WindowClass::About, WW, WH, WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + 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 5d0aa86878a2..4ed2ca6fc099 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -19,6 +19,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -343,7 +344,9 @@ namespace OpenRCT2::Ui::Windows WindowBase* AssetPacksOpen() { + auto* windowMgr = GetWindowManager(); auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN; - return WindowFocusOrCreate(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 0d675ba2d5d4..6f7b77a77262 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -312,12 +313,13 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* BannerOpen(rct_windownumber number) { - auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + auto* windowMgr = GetWindowManager(); + auto w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; - w = WindowCreate(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 a77331bdbf15..39f95be5e8df 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -318,7 +318,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ChangelogOpen(int personality) { - auto* window = WindowBringToFrontByClass(WindowClass::Changelog); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::Changelog); if (window == nullptr) { // Create a new centred window @@ -328,7 +329,7 @@ namespace OpenRCT2::Ui::Windows int32_t height = (screenHeight * 4) / 5; auto pos = ChangelogWindow::GetCentrePositionForNewWindow(width, height); - auto* newWindow = WindowCreate(WindowClass::Changelog, pos, width, height, WF_RESIZABLE); + auto* newWindow = windowMgr->Create(WindowClass::Changelog, pos, width, height, WF_RESIZABLE); newWindow->SetPersonality(personality); return newWindow; } diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index f294b55ac632..e1db565d5d0f 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1345,10 +1346,11 @@ static StringId window_cheats_page_titles[] = { WindowBase* CheatsOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::Cheats); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::Cheats); if (window == nullptr) { - window = WindowCreate(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 7749b36ef720..998046d7c116 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -343,7 +342,7 @@ namespace OpenRCT2::Ui::Windows { case WIDX_BACKGROUND: { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) { auto action = GetClearAction(); @@ -380,7 +379,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ClearSceneryOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( 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 ef5ae15b8541..804678185958 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -227,6 +228,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* CustomCurrencyOpen() { - return WindowFocusOrCreate(WindowClass::CustomCurrencyConfig, WW, WH, WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + 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 0973e14888a4..776136cf4afd 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -153,7 +154,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* DebugPaintOpen() { - auto* window = WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate( WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, WF_STICK_TO_FRONT | WF_TRANSPARENT); diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 1ae9cdc9b8b0..d3d87a8f5c93 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -9,13 +9,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -103,21 +101,20 @@ namespace OpenRCT2::Ui::Windows WindowBase* RideDemolishPromptOpen(const Ride& ride) { - WindowBase* w; - DemolishRidePromptWindow* newWindow; + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->FindByClass(WindowClass::DemolishRidePrompt); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); - w = windowMgr->FindByClass(WindowClass::DemolishRidePrompt); + DemolishRidePromptWindow* newWindow; if (w != nullptr) { auto windowPos = w->windowPos; WindowClose(*w); - newWindow = WindowCreate( + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } else { - newWindow = WindowCreate( + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 0a46a16f4cf5..80ddfec2efb8 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -357,7 +358,8 @@ namespace OpenRCT2::Ui::Windows WindowDropdownClose(); // Create the window (width/height position are set later) - auto* w = WindowCreate(WindowClass::Dropdown, width, custom_height, WF_STICK_TO_FRONT); + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->Create(WindowClass::Dropdown, width, custom_height, WF_STICK_TO_FRONT); if (w != nullptr) { w->SetTextItems(screenPos, extray, colour, custom_height, flags, num_items, width); @@ -390,7 +392,8 @@ namespace OpenRCT2::Ui::Windows WindowDropdownClose(); // Create the window (width/height position are set later) - auto* w = WindowCreate(WindowClass::Dropdown, itemWidth, itemHeight, WF_STICK_TO_FRONT); + auto* windowMgr = GetWindowManager(); + 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 47ccc32949c2..c0264ffd2cda 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -381,7 +382,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* EditorBottomToolbarOpen() { - auto* window = WindowCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->Create( WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 14819b9bc665..3b535d9915f4 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -26,7 +25,6 @@ #include #include #include -#include #include #include @@ -490,7 +488,7 @@ namespace OpenRCT2::Ui::Windows if (windowPos.x <= screenCoords.x && windowPos.y < screenCoords.y && windowPos.x + width > screenCoords.x && windowPos.y + height > screenCoords.y) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WidgetIndex widgetIndex = windowMgr->FindWidgetFromPoint(*this, screenCoords); auto& widget = widgets[widgetIndex]; @@ -595,7 +593,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* EditorInventionsListOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); } #pragma endregion @@ -615,7 +614,7 @@ namespace OpenRCT2::Ui::Windows CursorID OnCursor(const WidgetIndex widx, const ScreenCoordsXY& screenCoords, const CursorID defaultCursor) override { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* inventionListWindow = static_cast( windowMgr->FindByClass(WindowClass::EditorInventionList)); if (inventionListWindow != nullptr) @@ -634,7 +633,7 @@ namespace OpenRCT2::Ui::Windows void OnMoved(const ScreenCoordsXY& screenCoords) override { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* inventionListWindow = static_cast( windowMgr->FindByClass(WindowClass::EditorInventionList)); if (inventionListWindow == nullptr) @@ -691,8 +690,9 @@ namespace OpenRCT2::Ui::Windows static void WindowEditorInventionsListDragOpen( ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { + auto* windowMgr = Ui::GetWindowManager(); WindowCloseByClass(WindowClass::EditorInventionListDrag); - auto* wnd = WindowCreate( + auto* wnd = windowMgr->Create( WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); if (wnd != nullptr) { @@ -702,7 +702,7 @@ namespace OpenRCT2::Ui::Windows static const ResearchItem* WindowEditorInventionsListDragGetItem() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* wnd = static_cast(windowMgr->FindByClass(WindowClass::EditorInventionListDrag)); if (wnd == nullptr) { diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 092e3e7de2a4..fd5ccec6c6c2 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -1644,7 +1643,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* EditorObjectSelectionOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); } @@ -1746,7 +1746,7 @@ namespace OpenRCT2::Ui::Windows ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::EditorObjectSelection); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index d92065026497..2a7002d7322e 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -1169,11 +1170,12 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* EditorObjectiveOptionsOpen() { - auto window = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::EditorObjectiveOptions); if (window != nullptr) return window; - window = WindowCreate( + window = windowMgr->Create( WindowClass::EditorObjectiveOptions, 450, 225, WF_10 | WF_CENTRE_SCREEN); return window; diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 90ef9fa509b6..b5633a30c561 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -391,14 +392,13 @@ namespace OpenRCT2::Ui::Windows WindowBase* EditorParkEntranceOpen() { - WindowBase* window; - // Check if window is already open - window = WindowBringToFrontByClass(WindowClass::EditorParkEntrance); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::EditorParkEntrance); if (window != nullptr) return window; - window = WindowCreate( + window = windowMgr->Create( 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 e70fd52cecdb..f391348aad4e 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1254,6 +1255,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* EditorScenarioOptionsOpen() { - return WindowFocusOrCreate(WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( + WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 47d8686099dc..7321420fa035 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -138,7 +139,9 @@ namespace OpenRCT2::Ui::Windows windowPosition.y = std::clamp(windowPosition.y, 22, ContextGetHeight() - height - 40); auto errorWindow = std::make_unique(std::move(buffer), numLines, autoClose); - return WindowCreate( + + auto* windowMgr = GetWindowManager(); + return windowMgr->Create( std::move(errorWindow), WindowClass::Error, windowPosition, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 045214ed3481..480545424774 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -879,7 +879,8 @@ namespace OpenRCT2::Ui::Windows static FinancesWindow* FinancesWindowOpen(uint8_t page) { - auto* window = WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); + auto* windowMgr = Ui::GetWindowManager(); + auto* window = windowMgr->FocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY) window->SetPage(page); @@ -889,7 +890,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* FinancesOpen() { - return WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); + auto* windowMgr = Ui::GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); } WindowBase* FinancesResearchOpen() diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 05e5a3f3020c..86721e5db8dd 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -1236,7 +1235,7 @@ namespace OpenRCT2::Ui::Windows Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* self = static_cast(windowMgr->FindByClass(WindowClass::Footpath)); if (self == nullptr) { @@ -1627,7 +1626,8 @@ namespace OpenRCT2::Ui::Windows return nullptr; } - return WindowFocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); } void WindowFootpathResetSelectedPath() @@ -1637,7 +1637,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutTurnLeft() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1651,7 +1651,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutTurnRight() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1665,7 +1665,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutSlopeDown() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1679,7 +1679,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutSlopeUp() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1693,7 +1693,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutDemolishCurrent() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1707,7 +1707,7 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathKeyboardShortcutBuildCurrent() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::Footpath); if (w != nullptr) { @@ -1725,7 +1725,7 @@ namespace OpenRCT2::Ui::Windows */ void ToggleFootpathWindow() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Footpath) == nullptr) { ContextOpenWindow(WindowClass::Footpath); diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 636c64f94251..427a00475011 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -677,7 +678,8 @@ namespace OpenRCT2::Ui::Windows uint32_t line_height = FontGetLineHeight(FontStyle::Medium); uint32_t toolbar_height = line_height * 2 + 12; - GameBottomToolbar* window = WindowCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->Create( WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbar_height), screenWidth, toolbar_height, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index fb8372231d37..d980fa7b19ac 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -639,7 +638,7 @@ namespace OpenRCT2::Ui::Windows pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* wind = windowMgr->FindByNumber(WindowClass::Peep, peepnum); if (wind != nullptr) { @@ -1911,14 +1910,15 @@ namespace OpenRCT2::Ui::Windows return StaffOpen(peep); } - auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); + auto* windowMgr = GetWindowManager(); + auto* window = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); if (window == nullptr) { int32_t windowWidth = 192; if (Config::Get().general.DebuggingTools) windowWidth += TabWidth; - window = WindowCreate(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 353e5037c105..e4b5d54208f9 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -971,10 +970,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* GuestListOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::GuestList); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::GuestList); if (window == nullptr) { - window = WindowCreate(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); + window = windowMgr->Create(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); } return window; } @@ -994,7 +994,7 @@ namespace OpenRCT2::Ui::Windows void WindowGuestListRefreshList() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::GuestList); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index fd3aa0eda093..b6fbae9d206e 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -430,7 +431,8 @@ namespace OpenRCT2::Ui::Windows int32_t screenHeight = ContextGetHeight(); auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(kTopToolbarHeight + 1, screenHeight / 2 - 200) }; - auto* window = WindowFocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); 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 077ba3569cf5..d2284302af8f 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -400,7 +399,7 @@ namespace OpenRCT2::Ui::Windows */ void LandToolDrag(const ScreenCoordsXY& screenPos) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindFromPoint(screenPos); if (window == nullptr) return; @@ -873,7 +872,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* LandOpen() { - return WindowFocusOrCreate(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + auto* windowMgr = GetWindowManager(); + 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 157835ec2e0d..9fc9a52a12f6 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -585,7 +586,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* LandRightsOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( 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 c260c2e77603..b5f907984bb7 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1335,7 +1335,8 @@ namespace OpenRCT2::Ui::Windows const u8string path = GetDir(type); - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Loadsave)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByClass(WindowClass::Loadsave)); if (w == nullptr) { if (config.FileBrowserWidth < kWindowSizeMin.width || config.FileBrowserHeight < kWindowSizeMin.height @@ -1349,7 +1350,7 @@ namespace OpenRCT2::Ui::Windows auto width = config.FileBrowserWidth; auto height = config.FileBrowserHeight; - w = WindowCreate( + w = windowMgr->Create( WindowClass::Loadsave, width, height, WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, type); } @@ -1483,7 +1484,8 @@ namespace OpenRCT2::Ui::Windows { WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); - return WindowCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->Create( WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name, path); } diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 7710a0fce7f9..f77f751ff51b 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -75,7 +76,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* MainOpen() { - return WindowCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->Create( WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index a67ce9e82095..1e0cd726de3d 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -276,7 +275,7 @@ namespace OpenRCT2::Ui::Windows void OnMouseUp(WidgetIndex widgetIndex) override { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); switch (widgetIndex) { case WIDX_CLOSE: @@ -356,7 +355,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); // the flickering frequency is reduced by 4, compared to the original // it was done due to inability to reproduce original frequency @@ -600,7 +599,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); // Set the pressed widgets pressed_widgets = 0; @@ -1253,7 +1252,8 @@ namespace OpenRCT2::Ui::Windows { try { - WindowBase* w = WindowFocusOrCreate(WindowClass::Map, 245, 259, WF_10); + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->FocusOrCreate(WindowClass::Map, 245, 259, WF_10); w->selected_tab = 0; w->list_information_type = 0; return w; @@ -1266,10 +1266,9 @@ namespace OpenRCT2::Ui::Windows void WindowMapReset() { - WindowBase* w; - // Check if window is even opened - w = WindowBringToFrontByClass(WindowClass::Map); + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->BringToFrontByClass(WindowClass::Map); if (w == nullptr) { return; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 23e52cd64320..d5d71c1015d6 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1529,7 +1530,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* MapgenOpen() { - return WindowFocusOrCreate(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); } static void HeightmapLoadsaveCallback(int32_t result, const utf8* path) diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 3a7748134365..847bb67ff77f 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -97,7 +96,7 @@ namespace OpenRCT2::Ui::Windows std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); auto& im = GetInputManager(); - auto* wm = GetContext()->GetUiContext()->GetWindowManager(); + auto* wm = GetWindowManager(); if (_cursorHoldDuration < 25 || stringId == STR_NONE || im.IsModifierKeyPressed(ModifierKey::ctrl) || im.IsModifierKeyPressed(ModifierKey::shift) || wm->FindByClass(WindowClass::Error) != nullptr) { @@ -116,7 +115,7 @@ namespace OpenRCT2::Ui::Windows const CursorState* state = ContextGetCursorState(); auto pos = state->position + ScreenCoordsXY{ -width / 2, 15 }; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (auto w = windowMgr->FindByClass(WindowClass::MapTooltip)) { w->Invalidate(); @@ -126,7 +125,7 @@ namespace OpenRCT2::Ui::Windows } else { - w = WindowCreate( + w = windowMgr->Create( WindowClass::MapTooltip, pos, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); } } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index b64393bb22df..65644d68465e 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -437,13 +436,14 @@ namespace OpenRCT2::Ui::Windows WindowBase* MazeConstructionOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); } void WindowMazeConstructionUpdatePressedWidgets() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr) return; diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index a84614295289..86620fa64ab3 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -184,10 +185,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* MultiplayerOpen() { // Check if window is already open - WindowBase* window = WindowBringToFrontByClass(WindowClass::Multiplayer); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::Multiplayer); if (window == nullptr) { - window = WindowCreate( + window = windowMgr->Create( WindowClass::Multiplayer, 320, 144, WF_10 | WF_RESIZABLE | WF_AUTO_POSITION); } diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 0b80ce3268bc..0872cbf66c12 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -136,16 +135,16 @@ namespace OpenRCT2::Ui::Windows { ContextForceCloseWindowByClass(WindowClass::ProgressWindow); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); NetworkStatusWindow* window; if ((window = static_cast(windowMgr->FindByClass(WindowClass::NetworkStatus))) != nullptr) { - WindowBringToFront(*window); + windowMgr->BringToFront(*window); } else { - window = WindowCreate( + window = windowMgr->Create( WindowClass::NetworkStatus, 400, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); } @@ -157,7 +156,7 @@ namespace OpenRCT2::Ui::Windows // force close void WindowNetworkStatusClose() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = windowMgr->FindByClass(WindowClass::NetworkStatus); if (window == nullptr) { @@ -172,8 +171,10 @@ namespace OpenRCT2::Ui::Windows { ContextForceCloseWindowByClass(WindowClass::ProgressWindow); - auto window = WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate( 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); window->SetPassword(password); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 1fb2cdcc5762..054fbc397348 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +22,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -404,7 +402,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* NewCampaignOpen(int16_t campaignType) { - auto w = static_cast(WindowBringToFrontByClass(WindowClass::NewCampaign)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByClass(WindowClass::NewCampaign)); if (w != nullptr) { if (w->GetCampaignType() == campaignType) @@ -413,7 +412,7 @@ namespace OpenRCT2::Ui::Windows WindowClose(*w); } - w = WindowCreate(WindowClass::NewCampaign, WW, WH, 0); + w = windowMgr->Create(WindowClass::NewCampaign, WW, WH, 0); if (w != nullptr) { w->SetCampaign(campaignType); @@ -423,7 +422,7 @@ namespace OpenRCT2::Ui::Windows void WindowCampaignRefreshRides() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = static_cast(windowMgr->FindByClass(WindowClass::NewCampaign)); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index e17681f485d2..1cc4a7b5ee47 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -1071,9 +1070,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* NewRideOpen() { - WindowBase* window; - - window = WindowBringToFrontByClass(WindowClass::ConstructRide); + auto* windowMgr = Ui::GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::ConstructRide); if (window) { return window; @@ -1082,7 +1080,8 @@ namespace OpenRCT2::Ui::Windows WindowCloseByClass(WindowClass::TrackDesignList); WindowCloseByClass(WindowClass::TrackDesignPlace); - window = WindowCreate(WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); + window = windowMgr->Create( + WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); return window; } @@ -1099,7 +1098,7 @@ namespace OpenRCT2::Ui::Windows */ void WindowNewRideFocus(RideSelection rideItem) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = static_cast(windowMgr->FindByClass(WindowClass::ConstructRide)); if (!w) { diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 3881d3b223e4..17119ac07343 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -22,6 +22,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -323,6 +324,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* NewsOpen() { - return WindowFocusOrCreate(WindowClass::RecentNews, WW, WH, 0); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::RecentNews, WW, WH, 0); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index d4f374c8fae0..8e2e6de69ba3 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -282,6 +283,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* NewsOptionsOpen() { - return WindowFocusOrCreate(WindowClass::NotificationOptions, WW, WH, WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::NotificationOptions, WW, WH, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index e10784baa6cb..f64c3c873f9d 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -25,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -576,10 +576,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError); + auto* windowMgr = Ui::GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::ObjectLoadError); if (window == nullptr) { - window = WindowCreate(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 99dc413ab80a..8b44038a5978 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -12,14 +12,12 @@ * the window has been changed to a tab interface similar to the options window seen in Locomotion. */ -#include "../interface/Theme.h" - #include #include +#include #include #include #include -#include #include #include #include @@ -45,6 +43,7 @@ #include #include #include +#include using namespace OpenRCT2; using namespace OpenRCT2::Audio; @@ -2216,6 +2215,7 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* OptionsOpen() { - return WindowFocusOrCreate(WindowClass::Options, WW, WH, WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::Options, WW, WH, WF_CENTRE_SCREEN); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 47b058967472..8ecee3d56435 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -7,17 +7,15 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "../interface/Theme.h" - #include #include #include #include #include +#include #include #include #include -#include #include #include #include @@ -32,6 +30,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -1298,7 +1297,8 @@ namespace OpenRCT2::Ui::Windows static ParkWindow* ParkWindowOpen(uint8_t page) { - auto* wnd = WindowFocusOrCreate(WindowClass::ParkInformation, 230, 174 + 9, WF_10); + auto* windowMgr = GetWindowManager(); + 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 0c0129f24e7f..0cc33b2eab23 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -275,7 +274,7 @@ namespace OpenRCT2::Ui::Windows bool IsStaffWindowOpen() { // If staff window for this patrol area was closed, tool is no longer active - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto staffWindow = windowMgr->FindByNumber(WindowClass::Peep, _staffId); return staffWindow != nullptr; } @@ -294,7 +293,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* PatrolAreaOpen(EntityId staffId) { - auto w = WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->FocusOrCreate( WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); if (w != nullptr) { @@ -305,7 +305,7 @@ namespace OpenRCT2::Ui::Windows EntityId WindowPatrolAreaGetCurrentStaffId() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto current = reinterpret_cast(windowMgr->FindByClass(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 a191327c4a1e..e068814e9500 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -624,10 +625,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* PlayerOpen(uint8_t id) { - auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Player, id)); + auto* windowMgr = GetWindowManager(); + auto* window = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Player, id)); if (window == nullptr) { - window = WindowCreate(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 dec1db3bec05..4cd6dc0a3535 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -236,16 +235,16 @@ namespace OpenRCT2::Ui::Windows { ContextForceCloseWindowByClass(WindowClass::NetworkStatus); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); ProgressWindow* window; if ((window = static_cast(windowMgr->FindByClass(WindowClass::ProgressWindow))) != nullptr) { - WindowBringToFront(*window); + windowMgr->BringToFront(*window); } else { - window = WindowCreate( + window = windowMgr->Create( WindowClass::ProgressWindow, kWindowWidth, kWindowHeight, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); } @@ -257,7 +256,7 @@ namespace OpenRCT2::Ui::Windows void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = windowMgr->FindByClass(WindowClass::ProgressWindow); if (window == nullptr) { @@ -270,7 +269,7 @@ namespace OpenRCT2::Ui::Windows // Closes the window, deliberately *without* executing the callback. void ProgressWindowClose() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = windowMgr->FindByClass(WindowClass::ProgressWindow); if (window == nullptr) { diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index e157fb33b8a3..8c1c42a7945b 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -9,12 +9,10 @@ #include #include -#include #include #include #include #include -#include #include #include #include @@ -104,18 +102,18 @@ namespace OpenRCT2::Ui::Windows { RefurbishRidePromptWindow* newWindow; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::DemolishRidePrompt); if (w != nullptr) { auto windowPos = w->windowPos; WindowClose(*w); - newWindow = WindowCreate( + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } else { - newWindow = WindowCreate( + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 7b627ef14cb0..6dfcf9958139 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -304,7 +305,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ResearchOpen() { - ResearchWindow* window = WindowFocusOrCreate(WindowClass::Research, WW_FUNDING, WH_FUNDING, WF_10); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate(WindowClass::Research, WW_FUNDING, WH_FUNDING, 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 bffe17ffba72..9ecf0f814254 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -64,7 +64,6 @@ #include #include #include -#include #include #include #include @@ -1137,7 +1136,7 @@ namespace OpenRCT2::Ui::Windows if (newPage == WINDOW_RIDE_PAGE_VEHICLE) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto constructionWindow = windowMgr->FindByClass(WindowClass::RideConstruction); if (constructionWindow != nullptr && constructionWindow->number == number) { @@ -1633,7 +1632,7 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { RideConstructionStart(*ride); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByNumber(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr) { Close(); @@ -6939,7 +6938,8 @@ namespace OpenRCT2::Ui::Windows */ static RideWindow* WindowRideOpen(const Ride& ride) { - return WindowCreate(WindowClass::Ride, 316, 207, WF_10 | WF_RESIZABLE, ride); + auto* windowMgr = GetWindowManager(); + return windowMgr->Create(WindowClass::Ride, 316, 207, WF_10 | WF_RESIZABLE, ride); } /** @@ -6953,7 +6953,8 @@ namespace OpenRCT2::Ui::Windows return nullptr; } - RideWindow* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); + auto* windowMgr = GetWindowManager(); + RideWindow* w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); if (w == nullptr) { w = WindowRideOpen(ride); @@ -6990,7 +6991,8 @@ namespace OpenRCT2::Ui::Windows if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) return RideMainOpen(ride); - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); if (w == nullptr) { w = WindowRideOpen(ride); @@ -7080,7 +7082,7 @@ namespace OpenRCT2::Ui::Windows view++; } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = static_cast(windowMgr->FindByNumber(WindowClass::Ride, ride->id.ToUnderlying())); if (w != nullptr) { @@ -7118,7 +7120,7 @@ namespace OpenRCT2::Ui::Windows w = static_cast( openedPeepWindow ? windowMgr->FindByNumber(WindowClass::Ride, ride->id.ToUnderlying()) - : WindowBringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying())); + : windowMgr->BringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying())); } if (w == nullptr) @@ -7134,7 +7136,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideInvalidateVehicle(const Vehicle& vehicle) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = static_cast(windowMgr->FindByNumber(WindowClass::Ride, vehicle.ride.ToUnderlying())); if (w == nullptr) return; @@ -7152,7 +7154,7 @@ namespace OpenRCT2::Ui::Windows void WindowRidePaintResetVehicle(RideId rideIndex) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = static_cast(windowMgr->FindByNumber(WindowClass::Ride, rideIndex.ToUnderlying())); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index a073404c103a..0730fff3783e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -212,7 +211,7 @@ namespace OpenRCT2::Ui::Windows /* move to ride.c */ static void CloseRideWindowForConstruction(RideId rideId) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(WindowClass::Ride, rideId.ToUnderlying()); if (w != nullptr && w->page == 1) WindowClose(*w); @@ -2803,16 +2802,18 @@ namespace OpenRCT2::Ui::Windows WindowRideConstructionUpdateDisabledPieces(currentRide->type); + auto* windowMgr = GetWindowManager(); + const auto& rtd = currentRide->GetRideTypeDescriptor(); switch (rtd.ConstructionWindowContext) { case RideConstructionWindowContext::Maze: return ContextOpenWindowView(WV_MAZE_CONSTRUCTION); case RideConstructionWindowContext::Default: - return WindowCreate( + return windowMgr->Create( WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); } - return WindowCreate( + return windowMgr->Create( WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); } @@ -2820,7 +2821,7 @@ namespace OpenRCT2::Ui::Windows { if (_rideConstructionState == RideConstructionState::State0) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr) { @@ -2838,7 +2839,7 @@ namespace OpenRCT2::Ui::Windows static void WindowRideConstructionDoEntranceExitCheck() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::RideConstruction); auto ride = GetRide(_currentRideIndex); if (w == nullptr || ride == nullptr) @@ -3074,7 +3075,7 @@ namespace OpenRCT2::Ui::Windows { return; } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = static_cast(windowMgr->FindByClass(WindowClass::RideConstruction)); if (!window) { @@ -3306,7 +3307,7 @@ namespace OpenRCT2::Ui::Windows const auto& rtd = ride->GetRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto window = static_cast(windowMgr->FindByClass(WindowClass::RideConstruction)); if (!window) { @@ -3610,7 +3611,7 @@ namespace OpenRCT2::Ui::Windows auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); ContextBroadcastIntent(&intent); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr) break; @@ -3677,7 +3678,7 @@ namespace OpenRCT2::Ui::Windows _currentTrackSelectionFlags = 0; WindowRideConstructionUpdateActiveElements(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr) break; @@ -3731,7 +3732,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutTurnLeft() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { @@ -3982,7 +3983,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutTurnRight() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4236,7 +4237,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutUseTrackDefault() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4267,7 +4268,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutSlopeDown() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4378,7 +4379,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutSlopeUp() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { @@ -4489,7 +4490,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutChainLiftToggle() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) || w->widgets[WIDX_CHAIN_LIFT].type == WindowWidgetType::Empty) @@ -4502,7 +4503,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutBankLeft() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) @@ -4539,7 +4540,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutBankRight() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) @@ -4576,7 +4577,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutPreviousTrack() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_PREVIOUS_SECTION) || w->widgets[WIDX_PREVIOUS_SECTION].type == WindowWidgetType::Empty) @@ -4589,7 +4590,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutNextTrack() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_NEXT_SECTION) || w->widgets[WIDX_NEXT_SECTION].type == WindowWidgetType::Empty) @@ -4602,7 +4603,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutBuildCurrent() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) { @@ -4614,7 +4615,7 @@ namespace OpenRCT2::Ui::Windows void WindowRideConstructionKeyboardShortcutDemolishCurrent() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w == nullptr || WidgetIsDisabled(*w, WIDX_DEMOLISH) || w->widgets[WIDX_DEMOLISH].type == WindowWidgetType::Empty) { diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 5d2c49ac9c0b..07c974170bc3 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -977,10 +978,12 @@ namespace OpenRCT2::Ui::Windows WindowBase* RideListOpen() { // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::RideList); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::RideList); if (window == nullptr) { - window = WindowCreate(WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE); + window = windowMgr->Create( + 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 e454126c3559..2a100d9f2afe 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -229,8 +230,10 @@ namespace OpenRCT2::Ui::Windows } } + auto* windowMgr = GetWindowManager(); + // Check if window is already open - WindowBase* window = WindowBringToFrontByClass(WindowClass::SavePrompt); + auto* window = windowMgr->BringToFrontByClass(WindowClass::SavePrompt); if (window != nullptr) { WindowClose(*window); @@ -251,7 +254,7 @@ namespace OpenRCT2::Ui::Windows } auto savePromptWindow = std::make_unique(prompt_mode); - return WindowCreate( + return windowMgr->Create( std::move(savePromptWindow), WindowClass::SavePrompt, {}, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 65003c536215..b524bfa72a9a 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -767,7 +768,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ScenarioselectOpen(std::function callback) { - auto* window = static_cast(WindowBringToFrontByClass(WindowClass::ScenarioSelect)); + auto* windowMgr = GetWindowManager(); + auto* window = static_cast(windowMgr->BringToFrontByClass(WindowClass::ScenarioSelect)); if (window != nullptr) { return window; @@ -776,7 +778,7 @@ namespace OpenRCT2::Ui::Windows int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); ScreenCoordsXY screenPos = { (screenWidth - WW) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - WH) / 2) }; - window = WindowCreate(WindowClass::ScenarioSelect, screenPos, WW, WH, 0, callback); + window = windowMgr->Create(WindowClass::ScenarioSelect, screenPos, WW, WH, 0, callback); return window; } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 73730c019588..08e315a076c0 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -422,7 +421,7 @@ namespace OpenRCT2::Ui::Windows // Find out what scenery the cursor is over const CursorState* state = ContextGetCursorState(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WidgetIndex widgetIndex = windowMgr->FindWidgetFromPoint(*this, state->position); if (widgetIndex == WIDX_SCENERY_LIST) { @@ -451,7 +450,7 @@ namespace OpenRCT2::Ui::Windows { const CursorState* state = ContextGetCursorState(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* other = windowMgr->FindFromPoint(state->position); if (other == this) { @@ -2435,7 +2434,7 @@ namespace OpenRCT2::Ui::Windows const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outQuadrant, Direction* outRotation) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::Scenery); if (w == nullptr) @@ -2633,7 +2632,7 @@ namespace OpenRCT2::Ui::Windows void Sub6E1F34PathItem( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::Scenery); if (w == nullptr) @@ -2667,7 +2666,7 @@ namespace OpenRCT2::Ui::Windows void Sub6E1F34Wall( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outEdges) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::Scenery); if (w == nullptr) @@ -2758,7 +2757,7 @@ namespace OpenRCT2::Ui::Windows void Sub6E1F34LargeScenery( const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, Direction* outDirection) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::Scenery); if (w == nullptr) @@ -2860,7 +2859,7 @@ namespace OpenRCT2::Ui::Windows const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ, Direction* outDirection) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FindByClass(WindowClass::Scenery); if (w == nullptr) @@ -3210,10 +3209,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* SceneryOpen() { - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByClass(WindowClass::Scenery)); if (w == nullptr) { - w = WindowCreate(WindowClass::Scenery); + w = windowMgr->Create(WindowClass::Scenery); } return w; } @@ -3222,7 +3222,8 @@ namespace OpenRCT2::Ui::Windows const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, const std::optional tertiary, const std::optional rotation) { - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByClass(WindowClass::Scenery)); if (w != nullptr) { w->SetSelectedItem(scenery, primary, secondary, tertiary, rotation); @@ -3232,7 +3233,7 @@ namespace OpenRCT2::Ui::Windows void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) { // Should this bring to front? - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = static_cast(windowMgr->FindByClass(WindowClass::Scenery)); if (w != nullptr) { @@ -3259,7 +3260,7 @@ namespace OpenRCT2::Ui::Windows const ScenerySelection WindowSceneryGetTabSelection() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = static_cast(windowMgr->FindByClass(WindowClass::Scenery)); if (w != nullptr) { @@ -3273,7 +3274,7 @@ namespace OpenRCT2::Ui::Windows void WindowSceneryInit() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* w = static_cast(windowMgr->FindByClass(WindowClass::Scenery)); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 57a10df6758b..5c051064916a 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -11,11 +11,9 @@ #include #include #include -#include #include #include #include -#include #include #include @@ -207,11 +205,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* SceneryScatterOpen() { // Check if window is already open - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindByClass(WindowClass::SceneryScatter); if (window == nullptr) { - window = WindowCreate(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 0a2789fb2356..897479698702 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -25,6 +25,7 @@ #include #include #include + #include #include namespace OpenRCT2::Ui::Windows @@ -546,11 +547,12 @@ namespace OpenRCT2::Ui::Windows WindowBase* ServerListOpen() { // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::ServerList); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::ServerList); if (window != nullptr) return window; - window = WindowCreate( + window = windowMgr->Create( WindowClass::ServerList, WWIDTH_MIN, WHEIGHT_MIN, 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 0c966df47c81..543b74b3c95a 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -19,6 +19,7 @@ #include #include #include + #include #include namespace OpenRCT2::Ui::Windows @@ -283,7 +284,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ServerStartOpen() { - return WindowFocusOrCreate(WindowClass::ServerStart, WW, WH, WF_CENTRE_SCREEN); + auto* windowMgr = GetWindowManager(); + 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 9b079d8c5c46..781c17b7b059 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -81,8 +80,9 @@ namespace OpenRCT2::Ui::Windows auto registeredShortcut = shortcutManager.GetShortcut(shortcutId); if (registeredShortcut != nullptr) { + auto* windowMgr = GetWindowManager(); WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); - auto w = WindowCreate( + auto* w = windowMgr->Create( WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); if (w != nullptr) { @@ -544,7 +544,7 @@ namespace OpenRCT2::Ui::Windows void ChangeShortcutWindow::NotifyShortcutKeysWindow() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::KeyboardShortcutList); if (w != nullptr) { @@ -554,10 +554,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* ShortcutKeysOpen() { - auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList); + auto* windowMgr = GetWindowManager(); + auto w = windowMgr->BringToFrontByClass(WindowClass::KeyboardShortcutList); if (w == nullptr) { - w = WindowCreate(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); + w = windowMgr->Create(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); } return w; } @@ -600,7 +601,7 @@ namespace OpenRCT2::Ui::Windows { case WIDX_RESET_PROMPT_RESET: { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::KeyboardShortcutList); if (w != nullptr) { @@ -619,7 +620,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* ResetShortcutKeysPromptOpen() { - return WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate( WindowClass::ResetShortcutKeysPrompt, RESET_PROMPT_WW, RESET_PROMPT_WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); } #pragma endregion diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 3f3bf92f1999..3f140a525643 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -334,12 +335,13 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* SignOpen(rct_windownumber number) { - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; - w = WindowCreate(WindowClass::Banner, WW, WH, 0); + w = windowMgr->Create(WindowClass::Banner, WW, WH, 0); if (w == nullptr) return nullptr; @@ -357,12 +359,13 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* SignSmallOpen(rct_windownumber number) { - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + auto* windowMgr = GetWindowManager(); + auto* w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Banner, number)); if (w != nullptr) return w; - w = WindowCreate(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 eed00969f70c..9eeb6bf6e42d 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -381,7 +380,7 @@ namespace OpenRCT2::Ui::Windows if (result->Error != GameActions::Status::Ok) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); WindowBase* wind = windowMgr->FindByNumber(WindowClass::Peep, peepnum); if (wind != nullptr) { @@ -1276,13 +1275,13 @@ namespace OpenRCT2::Ui::Windows WindowBase* StaffOpen(Peep* peep) { - auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); + auto* windowMgr = GetWindowManager(); + auto w = static_cast(windowMgr->BringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); if (w != nullptr) return w; - w = WindowCreate(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 3b24b3b7a272..e8c1336db0d4 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -98,7 +99,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* StaffFirePromptOpen(Peep* peep) { // Check if the confirm window already exists - auto* window = WindowFocusOrCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate( 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 24928e529b82..63984bc27ec0 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -202,7 +201,7 @@ namespace OpenRCT2::Ui::Windows } // Enable highlighting of these staff members in map window - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Map) != nullptr) { for (auto peep : EntityList()) @@ -745,12 +744,13 @@ namespace OpenRCT2::Ui::Windows WindowBase* StaffListOpen() { - return WindowFocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); } void WindowStaffListRefresh() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindByClass(WindowClass::StaffList); if (window != nullptr) { diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 79db7aef42ce..d8f458a53309 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -364,7 +363,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* GetParentWindow() const { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); return HasParentWindow() ? windowMgr->FindByNumber(_parentWidget.window.classification, _parentWidget.window.number) : nullptr; } @@ -374,10 +373,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength) { + auto* windowMgr = GetWindowManager(); WindowCloseByClass(WindowClass::Textinput); auto height = TextInputWindow::CalculateWindowHeight(existing_text); - auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + auto w = windowMgr->Create(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); if (w != nullptr) { w->SetParentWindow(call_w, call_widget); @@ -390,8 +390,9 @@ namespace OpenRCT2::Ui::Windows std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, std::function callback, std::function cancelCallback) { + auto* windowMgr = GetWindowManager(); auto height = TextInputWindow::CalculateWindowHeight(initialValue); - auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + auto w = windowMgr->Create(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); if (w != nullptr) { w->SetTitle(title, description); @@ -424,7 +425,7 @@ namespace OpenRCT2::Ui::Windows } // The window can be potentially closed within a callback, we need to check if its still alive. - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); w = windowMgr->FindByNumber(wndClass, wndNumber); if (w != nullptr) w->Invalidate(); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 05a5c1e84940..0bf940d86572 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows @@ -387,7 +386,7 @@ namespace OpenRCT2::Ui::Windows pressed_widgets = pressedWidgets | (1 << widgetIndex); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Dropdown) == nullptr) { _classIndex = -1; @@ -972,14 +971,13 @@ namespace OpenRCT2::Ui::Windows WindowBase* ThemesOpen() { - WindowBase* window; - // Check if window is already open - window = WindowBringToFrontByClass(WindowClass::Themes); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::Themes); if (window != nullptr) return window; - window = WindowCreate(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 04b5faaae8d2..43b4473e8843 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -2440,15 +2439,16 @@ static uint64_t PageDisabledWidgets[] = { WindowBase* TileInspectorOpen() { - WindowBase* window = WindowBringToFrontByClass(WindowClass::TileInspector); + auto* windowMgr = GetWindowManager(); + WindowBase* window = windowMgr->BringToFrontByClass(WindowClass::TileInspector); if (window == nullptr) - window = WindowCreate(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); + window = windowMgr->Create(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); return window; } void WindowTileInspectorClearClipboard() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindByClass(WindowClass::TileInspector); if (window != nullptr) static_cast(window)->ClearClipboard(); @@ -2456,7 +2456,7 @@ static uint64_t PageDisabledWidgets[] = { void WindowTileInspectorKeyboardShortcutToggleInvisibility() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindByClass(WindowClass::TileInspector); if (window != nullptr) static_cast(window)->ToggleInvisibility(); diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index ef4b3d5837e5..27f8a17f2dd4 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -54,7 +55,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* TitleExitOpen() { - return WindowCreate( + auto* windowMgr = GetWindowManager(); + return windowMgr->Create( WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, WF_STICK_TO_BACK | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 81ab20ddf2bb..fc2502b09866 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -67,10 +68,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* TitleLogoOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::TitleLogo); if (window == nullptr) { - window = WindowCreate( + window = windowMgr->Create( WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); } return window; diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index ce3731dc7f98..fa60549afdad 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -121,7 +120,7 @@ namespace OpenRCT2::Ui::Windows { WindowBase* windowToOpen = nullptr; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); switch (widgetIndex) { @@ -129,7 +128,7 @@ namespace OpenRCT2::Ui::Windows windowToOpen = windowMgr->FindByClass(WindowClass::ScenarioSelect); if (windowToOpen != nullptr) { - WindowBringToFront(*windowToOpen); + windowMgr->BringToFront(*windowToOpen); } else { @@ -142,7 +141,7 @@ namespace OpenRCT2::Ui::Windows windowToOpen = windowMgr->FindByClass(WindowClass::Loadsave); if (windowToOpen != nullptr) { - WindowBringToFront(*windowToOpen); + windowMgr->BringToFront(*windowToOpen); } else { @@ -156,7 +155,7 @@ namespace OpenRCT2::Ui::Windows windowToOpen = windowMgr->FindByClass(WindowClass::ServerList); if (windowToOpen != nullptr) { - WindowBringToFront(*windowToOpen); + windowMgr->BringToFront(*windowToOpen); } else { @@ -287,7 +286,9 @@ namespace OpenRCT2::Ui::Windows WindowBase* TitleMenuOpen() { const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; - return WindowCreate( + + auto* windowMgr = GetWindowManager(); + return windowMgr->Create( WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), 0, windowHeight, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND); } diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 4657f236e5d5..6aa1ba29ec76 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -52,10 +53,11 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* TitleOptionsOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::TitleOptions); if (window == nullptr) { - window = WindowCreate( + window = windowMgr->Create( WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), 80, 15, WF_STICK_TO_BACK | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/TitleVersion.cpp b/src/openrct2-ui/windows/TitleVersion.cpp index 791a9049fb66..f117afc08722 100644 --- a/src/openrct2-ui/windows/TitleVersion.cpp +++ b/src/openrct2-ui/windows/TitleVersion.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -39,10 +40,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* TitleVersionOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::TitleVersion); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::TitleVersion); if (window == nullptr) { - window = WindowCreate( + window = windowMgr->Create( WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 16454fbc4b2d..848d3914446a 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -158,7 +159,9 @@ namespace OpenRCT2::Ui::Windows auto windowPos = tooltipWindow->windowPos; auto width = tooltipWindow->width; auto height = tooltipWindow->height; - WindowCreate( + + auto* windowMgr = GetWindowManager(); + windowMgr->Create( std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 098851dd155d..845dc8b1227a 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -777,7 +776,7 @@ namespace OpenRCT2::Ui::Windows void ApplyFootpathPressed() { // Footpath button pressed down - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Footpath) == nullptr) pressed_widgets &= ~(1uLL << WIDX_PATH); else @@ -998,7 +997,8 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* TopToolbarOpen() { - TopToolbar* window = WindowCreate( + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->Create( WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), kTopToolbarHeight + 1, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); @@ -1140,7 +1140,7 @@ namespace OpenRCT2::Ui::Windows break; case DDIDX_VIEW_CLIPPING: { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::ViewClipping) == nullptr) { ContextOpenWindow(WindowClass::ViewClipping); @@ -1509,7 +1509,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0].withFlag(ColourFlag::translucent, true), Dropdown::Flag::StayOpen, TOP_TOOLBAR_DEBUG_COUNT); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); Dropdown::SetChecked(DDIDX_DEBUG_PAINT, windowMgr->FindByClass(WindowClass::DebugPaint) != nullptr); } @@ -1528,7 +1528,7 @@ namespace OpenRCT2::Ui::Windows } case DDIDX_DEBUG_PAINT: { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::DebugPaint) == nullptr) { ContextOpenWindow(WindowClass::DebugPaint); diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index c82fbb3c5868..dd1153d6c0b0 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { @@ -109,7 +110,9 @@ namespace OpenRCT2::Ui::Windows { WindowCloseByClass(WindowClass::ManageTrackDesign); auto trackDesignManageWindow = std::make_unique(tdFileRef); - auto* window = WindowCreate( + + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->Create( std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); @@ -194,7 +197,9 @@ namespace OpenRCT2::Ui::Windows int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); auto trackDeletePromptWindow = std::make_unique(tdFileRef); - WindowCreate( + + auto* windowMgr = GetWindowManager(); + windowMgr->Create( std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, ScreenCoordsXY( std::max(kTopToolbarHeight + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index d35e59895e3f..b92f2983d525 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -279,7 +278,7 @@ namespace OpenRCT2::Ui::Windows // Unable to build track Audio::Play3D(Audio::SoundId::Error, trackLoc); - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = GetWindowManager(); windowManager->ShowError(res.GetErrorTitle(), res.GetErrorMessage()); return; } @@ -301,7 +300,7 @@ namespace OpenRCT2::Ui::Windows _currentRideIndex = rideId; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); if (TrackDesignAreEntranceAndExitPlaced()) { auto intent = Intent(WindowClass::Ride); @@ -737,7 +736,8 @@ namespace OpenRCT2::Ui::Windows WindowCloseConstructionWindows(); - auto* window = WindowFocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->FocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); if (window != nullptr) { window->Init(std::move(openTrackDesign)); @@ -747,7 +747,7 @@ namespace OpenRCT2::Ui::Windows void TrackPlaceClearProvisionalTemporarily() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* trackPlaceWnd = static_cast(windowMgr->FindByClass(WindowClass::TrackDesignPlace)); if (trackPlaceWnd != nullptr) { @@ -757,7 +757,7 @@ namespace OpenRCT2::Ui::Windows void TrackPlaceRestoreProvisional() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* trackPlaceWnd = static_cast(windowMgr->FindByClass(WindowClass::TrackDesignPlace)); if (trackPlaceWnd != nullptr) { diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index bbb102b292dc..d52cd5b8a48e 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -770,12 +769,13 @@ namespace OpenRCT2::Ui::Windows { screenPos = { 0, kTopToolbarHeight + 2 }; } - return WindowCreate(WindowClass::TrackDesignList, WW, WH, 0, item); + auto* windowMgr = GetWindowManager(); + return windowMgr->Create(WindowClass::TrackDesignList, WW, WH, 0, item); } void WindowTrackDesignListReloadTracks() { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* trackListWindow = static_cast(windowMgr->FindByClass(WindowClass::TrackDesignList)); if (trackListWindow != nullptr) { @@ -785,7 +785,7 @@ namespace OpenRCT2::Ui::Windows void WindowTrackDesignListSetBeingUpdated(const bool beingUpdated) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* trackListWindow = static_cast(windowMgr->FindByClass(WindowClass::TrackDesignList)); if (trackListWindow != nullptr) { diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 77381784cb80..9324e760856c 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include @@ -249,9 +249,10 @@ namespace OpenRCT2::Ui::Windows WindowBase* TransparencyOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::Transparency); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::Transparency); if (window == nullptr) - window = WindowCreate(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 15e30a91d120..9acb3b3836a3 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -400,10 +401,11 @@ namespace OpenRCT2::Ui::Windows WindowBase* ViewClippingOpen() { - auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping); + auto* windowMgr = GetWindowManager(); + auto* window = windowMgr->BringToFrontByClass(WindowClass::ViewClipping); if (window == nullptr) { - window = WindowCreate(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 13476843d1b0..2c9b7d3e80c2 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows @@ -229,7 +230,9 @@ namespace OpenRCT2::Ui::Windows int32_t width = (screenWidth / 2); int32_t height = (screenHeight / 2); - auto* w = WindowCreate(WindowClass::Viewport, std::max(WW, width), std::max(WH, height), WF_RESIZABLE); + auto* windowMgr = GetWindowManager(); + auto* w = windowMgr->Create( + WindowClass::Viewport, std::max(WW, width), std::max(WH, height), WF_RESIZABLE); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 8427e3ef8893..50f56e7a36ad 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -253,7 +252,7 @@ namespace OpenRCT2::Ui::Windows */ void WaterToolDrag(const ScreenCoordsXY& screenPos) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FindFromPoint(screenPos); if (window == nullptr || window->viewport == nullptr) return; @@ -426,7 +425,8 @@ namespace OpenRCT2::Ui::Windows WindowBase* WaterOpen() { - return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + auto* windowMgr = GetWindowManager(); + return windowMgr->FocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } /** diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d3b12419b4c8..d9df787f5226 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -1558,7 +1558,7 @@ namespace OpenRCT2 void ContextInit() { - GetContext()->GetUiContext()->GetWindowManager()->Init(); + GetWindowManager()->Init(); } bool ContextLoadParkFromStream(void* stream) @@ -1676,55 +1676,55 @@ void ContextSetCursorTrap(bool value) WindowBase* ContextOpenWindow(WindowClass wc) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); return windowManager->OpenWindow(wc); } WindowBase* ContextOpenWindowView(uint8_t wc) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); return windowManager->OpenView(wc); } WindowBase* ContextOpenDetailWindow(uint8_t type, int32_t id) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); return windowManager->OpenDetails(type, id); } WindowBase* ContextOpenIntent(Intent* intent) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); return windowManager->OpenIntent(intent); } void ContextBroadcastIntent(Intent* intent) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->BroadcastIntent(*intent); } void ContextForceCloseWindowByClass(WindowClass windowClass) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->ForceClose(windowClass); } WindowBase* ContextShowError(StringId title, StringId message, const Formatter& args, const bool autoClose /* = false */) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); return windowManager->ShowError(title, message, args, autoClose); } void ContextHandleInput() { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->HandleInput(); } void ContextInputHandleKeyboard(bool isTitle) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->HandleKeyboard(isTitle); } diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 7bef462b2fb6..9639c82e576e 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -325,7 +325,7 @@ namespace OpenRCT2::Editor return; } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); switch (GetGameState().EditorStep) { @@ -382,7 +382,7 @@ namespace OpenRCT2::Editor static void FinaliseMainView() { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); auto& gameState = GetGameState(); windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation); diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index ffb6c1eaf510..37dc1a304d15 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -451,7 +451,7 @@ namespace OpenRCT2::GameActions if (result.Error != GameActions::Status::Ok && shouldShowError) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->ShowError(result.GetErrorTitle(), result.GetErrorMessage()); } diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index 0868583de19f..a3fbede7557a 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -83,7 +83,7 @@ GameActions::Result ParkMarketingAction::Execute() const MarketingNewCampaign(campaign); // We are only interested in invalidating the finances (marketing) window - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_CASH)); return CreateResult(); diff --git a/src/openrct2/actions/ParkSetLoanAction.cpp b/src/openrct2/actions/ParkSetLoanAction.cpp index 38d92fd65fef..75ea2d3a713f 100644 --- a/src/openrct2/actions/ParkSetLoanAction.cpp +++ b/src/openrct2/actions/ParkSetLoanAction.cpp @@ -71,7 +71,7 @@ GameActions::Result ParkSetLoanAction::Execute() const gameState.Cash -= (gameState.BankLoan - _value); gameState.BankLoan = _value; - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_CASH)); return GameActions::Result(); } diff --git a/src/openrct2/actions/ParkSetResearchFundingAction.cpp b/src/openrct2/actions/ParkSetResearchFundingAction.cpp index f170d5139b84..2539fd7c1225 100644 --- a/src/openrct2/actions/ParkSetResearchFundingAction.cpp +++ b/src/openrct2/actions/ParkSetResearchFundingAction.cpp @@ -61,7 +61,7 @@ GameActions::Result ParkSetResearchFundingAction::Execute() const gameState.ResearchPriorities = _priorities; gameState.ResearchFundingLevel = _fundingAmount; - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_RESEARCH)); return GameActions::Result(); } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 51d45621ed76..a878603ff0ae 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -166,7 +166,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const WindowCloseByClass(WindowClass::NewCampaign); // Refresh windows that display the ride name - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_CAMPAIGN_RIDE_LIST)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_RIDE_LIST)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST)); diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index f03851e16f55..1709bcb776a2 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -89,7 +89,7 @@ GameActions::Result RideSetNameAction::Execute() const GfxInvalidateScreen(); // Refresh windows that display ride name - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_CAMPAIGN_RIDE_LIST)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_RIDE_LIST)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST)); diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index fb347cb3fbed..b3d4e86c866f 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -202,7 +202,7 @@ 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) - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* constructionWindow = windowMgr->FindByNumber(WindowClass::RideConstruction, _rideIndex.ToUnderlying()); if (constructionWindow != nullptr) { @@ -243,7 +243,7 @@ GameActions::Result RideSetStatusAction::Execute() const Guard::Assert(false, "Invalid ride status %u", _status); break; } - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_CAMPAIGN_RIDE_LIST)); return res; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index bec70cc448b1..560183e49421 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1455,7 +1455,7 @@ void Guest::CheckCantFindRide() GuestHeadingToRideId = RideId::GetNull(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(WindowClass::Peep, Id); if (w != nullptr) @@ -3145,7 +3145,7 @@ static void PeepLeavePark(Guest* peep) peep->InsertNewThought(PeepThoughtType::GoHome); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(WindowClass::Peep, peep->Id); if (w != nullptr) w->OnPrepareDraw(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 2c2e98ec922b..95ae2d995740 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -591,7 +591,7 @@ void PeepDecrementNumRiders(Peep* peep) */ void PeepWindowStateUpdate(Peep* peep) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(WindowClass::Peep, peep->Id.ToUnderlying()); if (w != nullptr) w->OnPrepareDraw(); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 83acf7116503..bc4daf17e2cd 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -1730,7 +1730,7 @@ namespace OpenRCT2 */ InteractionInfo GetMapCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32_t flags) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* window = windowMgr->FindFromPoint(screenCoords); return GetMapCoordinatesFromPosWindow(window, screenCoords, flags); } @@ -1783,7 +1783,7 @@ namespace OpenRCT2 // if unknown viewport visibility, use the containing window to discover the status if (viewport->visibility == VisibilityCache::Unknown) { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); auto owner = windowManager->GetOwner(viewport); if (owner != nullptr && owner->classification != WindowClass::MainWindow) { @@ -1819,7 +1819,7 @@ namespace OpenRCT2 static Viewport* ViewportFindFromPoint(const ScreenCoordsXY& screenCoords) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindFromPoint(screenCoords); if (w == nullptr) return nullptr; @@ -1848,7 +1848,7 @@ namespace OpenRCT2 */ std::optional ScreenGetMapXY(const ScreenCoordsXY& screenCoords, Viewport** viewport) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); // This will get the tile location but we will need the more accuracy WindowBase* window = windowMgr->FindFromPoint(screenCoords); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 82e12858628e..184c3351e421 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -165,7 +165,7 @@ static constexpr float window_scroll_locations[][2] = { } }); - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); windowManager->UpdateMouseWheel(); } @@ -472,84 +472,6 @@ static constexpr float window_scroll_locations[][2] = { return result; } - /** - * - * rct2: 0x006ECDA4 - */ - WindowBase* WindowBringToFront(WindowBase& w) - { - if (!(w.flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) - { - auto itSourcePos = WindowGetIterator(&w); - if (itSourcePos != g_window_list.end()) - { - // Insert in front of the first non-stick-to-front window - auto itDestPos = g_window_list.begin(); - for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) - { - auto& w2 = *it; - if (!(w2->flags & WF_STICK_TO_FRONT)) - { - itDestPos = it.base(); - break; - } - } - - g_window_list.splice(itDestPos, g_window_list, itSourcePos); - w.Invalidate(); - - if (w.windowPos.x + w.width < 20) - { - int32_t i = 20 - w.windowPos.x; - w.windowPos.x += i; - if (w.viewport != nullptr) - w.viewport->pos.x += i; - w.Invalidate(); - } - } - } - return &w; - } - - WindowBase* WindowBringToFrontByClassWithFlags(WindowClass cls, uint16_t flags) - { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); - WindowBase* w = windowMgr->FindByClass(cls); - if (w != nullptr) - { - w->flags |= flags; - w->Invalidate(); - w = WindowBringToFront(*w); - } - - return w; - } - - WindowBase* WindowBringToFrontByClass(WindowClass cls) - { - return WindowBringToFrontByClassWithFlags(cls, WF_WHITE_BORDER_MASK); - } - - /** - * - * rct2: 0x006ED78A - * cls (cl) - * number (dx) - */ - WindowBase* WindowBringToFrontByNumber(WindowClass cls, rct_windownumber number) - { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); - WindowBase* w = windowMgr->FindByNumber(cls, number); - if (w != nullptr) - { - w->flags |= WF_WHITE_BORDER_MASK; - w->Invalidate(); - w = WindowBringToFront(*w); - } - - return w; - } - /** * * rct2: 0x006EE65A @@ -834,7 +756,8 @@ static constexpr float window_scroll_locations[][2] = { // HACK: Prevents the redraw from failing when there is // a window on top of the viewport. - WindowBringToFront(w); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->BringToFront(w); w.Invalidate(); } @@ -1063,7 +986,7 @@ static constexpr float window_scroll_locations[][2] = { gCurrentToolWidget.widget_index); // Abort tool event - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByNumber( gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) @@ -1081,7 +1004,7 @@ static constexpr float window_scroll_locations[][2] = { if (gScreenFlags & SCREEN_FLAGS_EDITOR) return; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* titleWind = windowMgr->FindByClass(WindowClass::TitleMenu); if (titleWind != nullptr) { @@ -1145,7 +1068,7 @@ static constexpr float window_scroll_locations[][2] = { } } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* topWind = windowMgr->FindByClass(WindowClass::TopToolbar); if (topWind != nullptr) @@ -1338,4 +1261,10 @@ static constexpr float window_scroll_locations[][2] = { return w->viewport; } + + // TODO: declared in WindowManager.h; move when refactors continue + Ui::IWindowManager* Ui::GetWindowManager() + { + return GetContext()->GetUiContext()->GetWindowManager(); + } } // namespace OpenRCT2 diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 668e9445d86e..b58a62431de1 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -380,11 +380,6 @@ namespace OpenRCT2 void WindowSetWindowLimit(int32_t value); - WindowBase* WindowBringToFront(WindowBase& w); - WindowBase* WindowBringToFrontByClass(WindowClass cls); - WindowBase* WindowBringToFrontByClassWithFlags(WindowClass cls, uint16_t flags); - WindowBase* WindowBringToFrontByNumber(WindowClass cls, rct_windownumber number); - void WindowClose(WindowBase& window); void WindowCloseByClass(WindowClass cls); void WindowCloseByNumber(WindowClass cls, rct_windownumber number); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 0194e5ab8c3c..927cdba6b381 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -3543,7 +3543,7 @@ const char* NetworkGetGroupName(uint32_t index) void NetworkChatShowConnectedMessage() { - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = Ui::GetWindowManager(); std::string s = windowManager->GetKeyboardShortcutString("interface.misc.multiplayer_chat"); const char* sptr = s.c_str(); diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 8e91a15e7428..2776b271a9a0 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -99,7 +99,7 @@ static bool ShouldShowFPS() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return true; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); return windowMgr->FindByClass(WindowClass::TopToolbar); } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index a376e5443fa3..c55117b4d61f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -765,7 +765,7 @@ bool Ride::FindTrackGap(const CoordsXYE& input, CoordsXYE* output) const if (rtd.specialType == RtdSpecialType::maze) return false; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == id) { @@ -2702,7 +2702,7 @@ static ResultWithMessage RideCheckBlockBrakes(const CoordsXYE& input, CoordsXYE* RideId rideIndex = input.element->AsTrack()->GetRideIndex(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) RideConstructionInvalidateCurrentTrack(); @@ -2767,7 +2767,7 @@ static bool RideCheckTrackContainsInversions(const CoordsXYE& input, CoordsXYE* return true; } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { @@ -2828,7 +2828,7 @@ static bool RideCheckTrackContainsBanked(const CoordsXYE& input, CoordsXYE* outp if (rtd.specialType == RtdSpecialType::maze) return true; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { @@ -2870,7 +2870,7 @@ static bool RideCheckTrackContainsBanked(const CoordsXYE& input, CoordsXYE* outp */ static int32_t RideCheckStationLength(const CoordsXYE& input, CoordsXYE* output) { - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == input.element->AsTrack()->GetRideIndex()) @@ -2933,7 +2933,7 @@ static bool RideCheckStartAndEndIsStation(const CoordsXYE& input) if (ride == nullptr) return false; - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); auto w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { @@ -3971,7 +3971,7 @@ void Ride::ConstructMissingEntranceOrExit() const return; } - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr) w->OnMouseUp(entranceOrExit); @@ -5018,7 +5018,7 @@ static int32_t RideGetTrackLength(const Ride& ride) RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::RideConstruction); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) { diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index e97cc55fc04a..000a34435e7d 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -119,7 +119,7 @@ static int32_t ride_check_if_construction_allowed(Ride& ride) static WindowBase* ride_create_or_find_construction_window(RideId rideIndex) { - auto* windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowManager = Ui::GetWindowManager(); auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); intent.PutExtra(INTENT_EXTRA_RIDE_ID, rideIndex.ToUnderlying()); windowManager->BroadcastIntent(intent); @@ -238,7 +238,7 @@ void RideClearForConstruction(Ride& ride) ride.RemoveVehicles(); RideClearBlockedTiles(ride); - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); auto w = windowMgr->FindByNumber(WindowClass::Ride, ride.id.ToUnderlying()); if (w != nullptr) w->OnResize(); @@ -833,7 +833,7 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) auto stationIndex = entranceElement->GetStationIndex(); // Get or create construction window for ride - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); auto constructionWindow = windowMgr->FindByClass(WindowClass::RideConstruction); if (constructionWindow == nullptr) { diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index d8c4b290f2a0..32ef8bed0bdd 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -592,7 +592,7 @@ Vehicle* TryGetVehicle(EntityId spriteIndex) void VehicleSoundsUpdate() { - auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::Ui::GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_VEHICLE_SOUNDS)); } diff --git a/src/openrct2/ui/DummyWindowManager.cpp b/src/openrct2/ui/DummyWindowManager.cpp index 383a5c7b6a56..7b5b848bafd4 100644 --- a/src/openrct2/ui/DummyWindowManager.cpp +++ b/src/openrct2/ui/DummyWindowManager.cpp @@ -69,6 +69,14 @@ namespace OpenRCT2::Ui { return nullptr; } + + WindowBase* Create( + std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, + uint32_t flags) override + { + return nullptr; + } + WindowBase* FindByClass(WindowClass cls) override { return nullptr; @@ -89,6 +97,23 @@ namespace OpenRCT2::Ui { return kWidgetIndexNull; } + + WindowBase* BringToFront(WindowBase& w) override + { + return nullptr; + } + WindowBase* BringToFrontByClass(WindowClass cls) override + { + return nullptr; + } + WindowBase* BringToFrontByClassWithFlags(WindowClass cls, uint16_t flags) override + { + return nullptr; + } + WindowBase* BringToFrontByNumber(WindowClass cls, rct_windownumber number) override + { + return nullptr; + } }; std::unique_ptr CreateDummyWindowManager() diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index 7fb6ca2c2d21..de4049863139 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -43,12 +43,60 @@ namespace OpenRCT2::Ui virtual void UpdateMouseWheel() = 0; virtual WindowBase* GetOwner(const Viewport* viewport) = 0; + virtual WindowBase* Create( + std::unique_ptr&& w, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags) + = 0; + + template::value>::type* = nullptr> + T* Create( + WindowClass cls, const ScreenCoordsXY& pos = {}, int32_t width = 0, int32_t height = 0, uint32_t flags = 0, + TArgs&&... args) + { + return static_cast(Create(std::make_unique(std::forward(args)...), cls, pos, width, height, flags)); + } + + template::value>::type* = nullptr> + T* Create(WindowClass cls, int32_t width, int32_t height, uint32_t flags, TArgs&&... args) + { + return static_cast( + Create(std::make_unique(std::forward(args)...), cls, {}, width, height, flags | WF_AUTO_POSITION)); + } + + template::value>::type* = nullptr> + T* FocusOrCreate(WindowClass cls, const ScreenCoordsXY& pos, int32_t width, int32_t height, uint32_t flags = 0) + { + auto* w = BringToFrontByClass(cls); + if (w == nullptr) + { + w = Create(cls, pos, width, height, flags); + } + return static_cast(w); + } + + template::value>::type* = nullptr> + T* FocusOrCreate(WindowClass cls, int32_t width, int32_t height, uint32_t flags = 0) + { + auto* w = BringToFrontByClass(cls); + if (w == nullptr) + { + w = Create(cls, width, height, flags); + } + return static_cast(w); + } + virtual WindowBase* FindByClass(WindowClass cls) = 0; virtual WindowBase* FindByNumber(WindowClass cls, rct_windownumber number) = 0; virtual WindowBase* FindByNumber(WindowClass cls, EntityId id) = 0; virtual WindowBase* FindFromPoint(const ScreenCoordsXY& screenCoords) = 0; virtual WidgetIndex FindWidgetFromPoint(WindowBase& w, const ScreenCoordsXY& screenCoords) = 0; + + virtual WindowBase* BringToFront(WindowBase& w) = 0; + virtual WindowBase* BringToFrontByClass(WindowClass cls) = 0; + virtual WindowBase* BringToFrontByClassWithFlags(WindowClass cls, uint16_t flags) = 0; + virtual WindowBase* BringToFrontByNumber(WindowClass cls, rct_windownumber number) = 0; }; std::unique_ptr CreateDummyWindowManager(); + + IWindowManager* GetWindowManager(); } // namespace OpenRCT2::Ui diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 843e74dc3bf9..0fea265f7601 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -86,7 +86,7 @@ namespace OpenRCT2::TileInspector static bool IsTileSelected(const CoordsXY& loc) { // Return true for everyone who has the window open and tile selected - auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager(); + auto* windowMgr = Ui::GetWindowManager(); auto* window = windowMgr->FindByClass(WindowClass::TileInspector); return window != nullptr && loc == windowTileInspectorTile.ToCoordsXY(); } From 5fbe8d0ae16361b5e246819fb3f56588d43ecfaf Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 19 Jan 2025 15:50:54 +0100 Subject: [PATCH 3/8] Centralise external window signatures in Windows.h (#23653) --- src/openrct2-ui/ProvisionalElements.cpp | 2 +- src/openrct2-ui/TextComposition.cpp | 3 +- src/openrct2-ui/WindowManager.cpp | 5 +- src/openrct2-ui/input/InputManager.cpp | 3 +- src/openrct2-ui/input/MouseInput.cpp | 2 +- src/openrct2-ui/input/Shortcuts.cpp | 2 +- .../interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/interface/Widget.cpp | 1 + src/openrct2-ui/interface/Window.cpp | 2 +- src/openrct2-ui/interface/Window.h | 26 -- src/openrct2-ui/libopenrct2ui.vcxproj | 2 +- src/openrct2-ui/ride/VehicleSounds.cpp | 1 + src/openrct2-ui/scripting/CustomListView.cpp | 2 +- src/openrct2-ui/scripting/CustomWindow.cpp | 2 +- src/openrct2-ui/scripting/ScUi.hpp | 2 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/About.cpp | 2 +- src/openrct2-ui/windows/AssetPacks.cpp | 2 +- src/openrct2-ui/windows/Banner.cpp | 2 +- src/openrct2-ui/windows/Changelog.cpp | 2 +- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2-ui/windows/ClearScenery.cpp | 2 +- src/openrct2-ui/windows/CustomCurrency.cpp | 2 +- src/openrct2-ui/windows/DebugPaint.cpp | 2 +- .../windows/DemolishRidePrompt.cpp | 2 +- .../windows/EditorBottomToolbar.cpp | 2 +- .../windows/EditorInventionsList.cpp | 2 +- .../windows/EditorObjectSelection.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 2 +- .../windows/EditorParkEntrance.cpp | 2 +- .../windows/EditorScenarioOptions.cpp | 2 +- src/openrct2-ui/windows/Error.cpp | 2 +- src/openrct2-ui/windows/Finances.cpp | 2 +- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 2 +- src/openrct2-ui/windows/InstallTrack.cpp | 2 +- src/openrct2-ui/windows/Land.cpp | 2 +- src/openrct2-ui/windows/LandRights.cpp | 2 +- src/openrct2-ui/windows/LoadSave.cpp | 2 +- src/openrct2-ui/windows/Main.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 2 +- src/openrct2-ui/windows/MapTooltip.cpp | 2 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 2 +- src/openrct2-ui/windows/NetworkStatus.cpp | 2 +- src/openrct2-ui/windows/NewCampaign.cpp | 2 +- src/openrct2-ui/windows/NewRide.cpp | 2 +- src/openrct2-ui/windows/News.cpp | 2 +- src/openrct2-ui/windows/NewsOptions.cpp | 2 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 2 +- src/openrct2-ui/windows/Options.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2-ui/windows/PatrolArea.cpp | 2 +- src/openrct2-ui/windows/Player.cpp | 2 +- src/openrct2-ui/windows/ProgressWindow.cpp | 2 +- .../windows/RefurbishRidePrompt.cpp | 2 +- src/openrct2-ui/windows/Research.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/SavePrompt.cpp | 2 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 2 +- src/openrct2-ui/windows/Scenery.cpp | 2 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/ServerStart.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 2 +- src/openrct2-ui/windows/Sign.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2-ui/windows/TextInput.cpp | 2 +- src/openrct2-ui/windows/Themes.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2-ui/windows/TitleExit.cpp | 2 +- src/openrct2-ui/windows/TitleLogo.cpp | 2 +- src/openrct2-ui/windows/TitleMenu.cpp | 2 +- src/openrct2-ui/windows/TitleOptions.cpp | 2 +- src/openrct2-ui/windows/TitleVersion.cpp | 2 +- src/openrct2-ui/windows/Tooltip.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 2 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 2 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 2 +- src/openrct2-ui/windows/Transparency.cpp | 2 +- src/openrct2-ui/windows/ViewClipping.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 2 +- src/openrct2-ui/windows/Water.cpp | 2 +- .../windows/{Window.h => Windows.h} | 360 ++++++++++++------ 92 files changed, 341 insertions(+), 228 deletions(-) rename src/openrct2-ui/windows/{Window.h => Windows.h} (76%) diff --git a/src/openrct2-ui/ProvisionalElements.cpp b/src/openrct2-ui/ProvisionalElements.cpp index 0d16339bdc00..273587155511 100644 --- a/src/openrct2-ui/ProvisionalElements.cpp +++ b/src/openrct2-ui/ProvisionalElements.cpp @@ -9,7 +9,7 @@ #include "ProvisionalElements.h" -#include +#include #include #include #include diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 55bbf7eeb977..789fc979c31e 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -12,9 +12,10 @@ #include "UiContext.h" #include "UiStringIds.h" #include "interface/InGameConsole.h" +#include "interface/Window.h" #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 6f1068b2399e..1c77a8d2322b 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -10,15 +10,16 @@ #include "WindowManager.h" #include "interface/Theme.h" +#include "interface/Window.h" #include "ride/VehicleSounds.h" -#include "windows/Window.h" +#include "windows/Windows.h" #include #include #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 0ec239cabee4..13de6798b270 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -16,7 +16,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 49fef8388e24..2a6087a2d81b 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 4f7e51738f98..de1401101c29 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index e8dd7577e67b..75b866915250 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -11,7 +11,7 @@ #include "../ProvisionalElements.h" #include "../UiStringIds.h" -#include "../windows/Window.h" +#include "../windows/Windows.h" #include "Viewport.h" #include "Window.h" diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 50ef0d823458..17fe15838782 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 970a8408f6bd..82a567b29f5c 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index 107610f47df3..a05dc8acd7fd 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -55,32 +55,6 @@ namespace OpenRCT2 namespace OpenRCT2::Ui::Windows { - void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); - void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); - void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); - void UpdateGhostTrackAndArrow(); - 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 WindowFootpathKeyboardShortcutTurnLeft(); - void WindowFootpathKeyboardShortcutTurnRight(); - void WindowFootpathKeyboardShortcutSlopeDown(); - void WindowFootpathKeyboardShortcutSlopeUp(); - void WindowFootpathKeyboardShortcutBuildCurrent(); - void WindowFootpathKeyboardShortcutDemolishCurrent(); - - void WindowTileInspectorKeyboardShortcutToggleInvisibility(); - extern const StringId ColourSchemeNames[4]; WindowBase* WindowGetListening(); diff --git a/src/openrct2-ui/libopenrct2ui.vcxproj b/src/openrct2-ui/libopenrct2ui.vcxproj index ff830f6af9ee..7f0ebcde922d 100644 --- a/src/openrct2-ui/libopenrct2ui.vcxproj +++ b/src/openrct2-ui/libopenrct2ui.vcxproj @@ -101,7 +101,7 @@ - + diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index 6e5ec4a89abf..9f081c4c8a0f 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -2,6 +2,7 @@ #include "../interface/Viewport.h" #include "../interface/Window.h" +#include "../windows/Windows.h" #include #include diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index c7841755d9ba..5039e8162d17 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -13,7 +13,7 @@ #include "../interface/Viewport.h" #include "../interface/Widget.h" - #include "../interface/Window.h" + #include "../windows/Windows.h" #include #include diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index b1dffc6b3ef2..ff5d1605e54c 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -15,7 +15,7 @@ #include "../interface/Widget.h" #include "../scripting/ScGraphicsContext.hpp" #include "../scripting/ScWidget.hpp" - #include "../windows/Window.h" + #include "../windows/Windows.h" #include "CustomListView.h" #include "ScUi.hpp" #include "ScWindow.hpp" diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 1b9503021e9d..4c38829832c2 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -11,7 +11,7 @@ #ifdef ENABLE_SCRIPTING - #include "../windows/Window.h" + #include "../windows/Windows.h" #include "CustomMenu.h" #include "ScImageManager.hpp" #include "ScTileSelection.hpp" diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index f4da02696f8b..28a215dc6067 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -12,7 +12,7 @@ #include "../interface/Window.h" #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 4e1c58483fbf..7724b10b5434 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index 4ed2ca6fc099..1f3dbe48ddb0 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -10,7 +10,7 @@ #include "../UiStringIds.h" #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 6f7b77a77262..5779bc398fb4 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 39f95be5e8df..71a000a4a64c 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index e1db565d5d0f..f27abb9144b1 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 998046d7c116..95b838b64678 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 804678185958..c5882a165129 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 776136cf4afd..cb015859e5b0 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index d3d87a8f5c93..1e5715a57fbd 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index c0264ffd2cda..518be08b6692 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -10,7 +10,7 @@ #include "../interface/Theme.h" #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 3b535d9915f4..cf05cc2111b6 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index fd5ccec6c6c2..e53405712b69 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 2a7002d7322e..8b3a7ffdfe93 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -11,7 +11,7 @@ #include "../interface/Dropdown.h" #include "../interface/Widget.h" #include "../interface/Window.h" -#include "Window.h" +#include "Windows.h" #include #include diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index b5633a30c561..8eb06b64792b 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index f391348aad4e..617ac2810b2a 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -11,7 +11,7 @@ #include "../interface/Dropdown.h" #include "../interface/Widget.h" #include "../interface/Window.h" -#include "Window.h" +#include "Windows.h" #include #include diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 7321420fa035..4bb7d73e89b6 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 480545424774..6992a2bdc86d 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 86721e5db8dd..fdf03440450f 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 427a00475011..4a33c57e4adb 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -10,7 +10,7 @@ #include "../interface/Theme.h" #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index d980fa7b19ac..15e5f9d15f50 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index e4b5d54208f9..31b15cf3391e 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index b6fbae9d206e..91eb196d9fb8 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index d2284302af8f..e0975597edc7 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 9fc9a52a12f6..19bee0c291b2 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index b5f907984bb7..a356701ea171 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index f77f751ff51b..e82644cb516d 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1e0cd726de3d..1f27a32131f7 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index d5d71c1015d6..22ccfaeeef49 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 847bb67ff77f..111460ad0ecb 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 65644d68465e..7e6fa9aa161a 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 86620fa64ab3..baeeb8a986a8 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 0872cbf66c12..b38958ca7750 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 054fbc397348..26beebf5ff38 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 1cc4a7b5ee47..6a596e16d942 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 17119ac07343..974db6a58750 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 8e2e6de69ba3..fbdeefc87f3c 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index f64c3c873f9d..3f2d0d2bcf75 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 8b44038a5978..19d55ac6b5b9 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 8ecee3d56435..ab45c1528926 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 0cc33b2eab23..e2fcb7cb6d86 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index e068814e9500..116d63dd41b8 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index 4cd6dc0a3535..e80b0188b040 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index 8c1c42a7945b..ac48088e42dd 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 6dfcf9958139..e15635a2102e 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 9ecf0f814254..aa5c262f8b33 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 0730fff3783e..5d300dd4bc24 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 07c974170bc3..f397053326ba 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 2a100d9f2afe..3af88206462f 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index b524bfa72a9a..7341aafffa7c 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 08e315a076c0..074018defdf2 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 5c051064916a..5775a101276d 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 897479698702..e8f630796641 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -13,7 +13,7 @@ #include #include #include - #include + #include #include #include #include diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 543b74b3c95a..05dad60489fa 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -12,7 +12,7 @@ #include "../interface/Theme.h" #include - #include + #include #include #include #include diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 781c17b7b059..ccf85a74754b 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -7,7 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "Window.h" +#include "Windows.h" #include #include diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 3f140a525643..09ad795111a8 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 9eeb6bf6e42d..b7a8290f91c4 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index e8c1336db0d4..40a6a3eb0ced 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 63984bc27ec0..b66b2d280c35 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index d8f458a53309..931d5ad063ac 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 0bf940d86572..79e6094e5ff9 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 43b4473e8843..02670ae7e85d 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 27f8a17f2dd4..b5a88e960090 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index fc2502b09866..f5b425a5ea62 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index fa60549afdad..6c58d6d3782c 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 6aa1ba29ec76..5358c56fd806 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include diff --git a/src/openrct2-ui/windows/TitleVersion.cpp b/src/openrct2-ui/windows/TitleVersion.cpp index f117afc08722..3e9735d89e55 100644 --- a/src/openrct2-ui/windows/TitleVersion.cpp +++ b/src/openrct2-ui/windows/TitleVersion.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 848d3914446a..9382a3f9eaca 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 845dc8b1227a..b1cf49634508 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index dd1153d6c0b0..402c8bbee68c 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index b92f2983d525..8f7d521ccf15 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index d52cd5b8a48e..4841a6a05b59 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 9324e760856c..6656dcb31f5d 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 9acb3b3836a3..2758f22886c2 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 2c9b7d3e80c2..368e8fb70186 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 50f56e7a36ad..8d7e4c635a5e 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Windows.h similarity index 76% rename from src/openrct2-ui/windows/Window.h rename to src/openrct2-ui/windows/Windows.h index a953b8954ca6..548abfc9b5af 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Windows.h @@ -9,12 +9,16 @@ #pragma once -#include #include +#include #include +#include #include +class Formatter; + struct ObjectEntryDescriptor; +struct OpenRCT2String; struct Peep; struct Ride; struct RideSelection; @@ -37,109 +41,175 @@ namespace OpenRCT2::Ui::Windows extern bool gWindowSceneryEyedropperEnabled; extern bool gDisableErrorWindowSound; + // About WindowBase* AboutOpen(); - void WindowCampaignRefreshRides(); + + // AssetPacks + WindowBase* AssetPacksOpen(); + + // Banner + WindowBase* BannerOpen(rct_windownumber number); + + // Changelog WindowBase* ChangelogOpen(int personality); + + // Cheats WindowBase* CheatsOpen(); + // ClearScenery WindowBase* ClearSceneryOpen(); void ToggleClearSceneryWindow(); + // CustomCurrency WindowBase* CustomCurrencyOpen(); + + // DebugPaint WindowBase* DebugPaintOpen(); + + // DemolishRidePrompt + WindowBase* RideDemolishPromptOpen(const Ride& ride); + + // EditorInventionsList WindowBase* EditorInventionsListOpen(); - WindowBase* EditorMainOpen(); + + // EditorBottomToolbar + WindowBase* EditorBottomToolbarOpen(); + + // EditorObjectiveOptions WindowBase* EditorObjectiveOptionsOpen(); + + // EditorObjectSelection + WindowBase* EditorObjectSelectionOpen(); + bool EditorObjectSelectionWindowCheck(); + + // EditorParkEntrance + WindowBase* EditorParkEntranceOpen(); + + // EditorScenarioOptions WindowBase* EditorScenarioOptionsOpen(); + // Error + WindowBase* ErrorOpen(StringId title, StringId message, const class Formatter& formatter, bool autoClose = false); + WindowBase* ErrorOpen(std::string_view title, std::string_view message, bool autoClose = false); + + // Finances + WindowBase* FinancesOpen(); + WindowBase* FinancesResearchOpen(); + WindowBase* FinancesMarketingOpen(); + + // Footpath WindowBase* FootpathOpen(); void WindowFootpathResetSelectedPath(); void ToggleFootpathWindow(); + void WindowFootpathKeyboardShortcutTurnLeft(); + void WindowFootpathKeyboardShortcutTurnRight(); + void WindowFootpathKeyboardShortcutSlopeDown(); + void WindowFootpathKeyboardShortcutSlopeUp(); + void WindowFootpathKeyboardShortcutBuildCurrent(); + void WindowFootpathKeyboardShortcutDemolishCurrent(); + + // GameBottomToolbar + extern uint8_t gToolbarDirtyFlags; + WindowBase* GameBottomToolbarOpen(); + void WindowGameBottomToolbarInvalidateNewsItem(); + // Guest WindowBase* GuestOpen(Peep* peep); + // GuestList + WindowBase* GuestListOpen(); + WindowBase* GuestListOpenWithFilter(GuestListFilterType type, int32_t index); + void WindowGuestListRefreshList(); + + // InstallTrack + WindowBase* InstallTrackOpen(const utf8* path); + + // Land WindowBase* LandOpen(); void ToggleLandWindow(); + // LandRights WindowBase* LandRightsOpen(); + // LoadSave + WindowBase* LoadsaveOpen( + int32_t type, std::string_view defaultPath, std::function callback, + TrackDesign* trackDesign); + void WindowLoadSaveInputKey(WindowBase* w, uint32_t keycode); + void WindowLoadSaveOverwritePromptInputKey(WindowBase* w, uint32_t keycode); + + // Main WindowBase* MainOpen(); + + // Map + WindowBase* MapOpen(); + void WindowMapReset(); + + // MapGen WindowBase* MapgenOpen(); + + // MapTooltip + void SetMapTooltip(Formatter& ft); + const Formatter& GetMapTooltip(); + void WindowMapTooltipUpdateVisibility(); + + // MazeConstruction + WindowBase* MazeConstructionOpen(); + void WindowMazeConstructionUpdatePressedWidgets(); + + // Multiplatyer WindowBase* MultiplayerOpen(); + + // NewCampaign + WindowBase* NewCampaignOpen(int16_t campaignType); + void WindowCampaignRefreshRides(); + + // NewRide + WindowBase* NewRideOpen(); + WindowBase* NewRideOpenResearch(); + void WindowNewRideInitVars(); + void WindowNewRideFocus(RideSelection rideItem); + + // News WindowBase* NewsOpen(); + + // NewsOptions WindowBase* NewsOptionsOpen(); - WindowBase* OptionsOpen(); - WindowBase* SavePromptOpen(); -#ifndef DISABLE_NETWORK - WindowBase* ServerListOpen(); - WindowBase* ServerStartOpen(); -#endif - WindowBase* ShortcutKeysOpen(); - WindowBase* StaffListOpen(); - WindowBase* StaffOpen(Peep* peep); - void WindowStaffListRefresh(); - WindowBase* ThemesOpen(); - WindowBase* TitleExitOpen(); - WindowBase* TitleLogoOpen(); - WindowBase* TitleMenuOpen(); - WindowBase* TitleOptionsOpen(); - WindowBase* TitleVersionOpen(); - WindowBase* ViewportOpen(); - WindowBase* WaterOpen(); - void ToggleWaterWindow(); + // NetworkStatus + WindowBase* NetworkStatusOpen(const std::string& text, CloseCallback onClose); + WindowBase* NetworkStatusOpenPassword(); + void WindowNetworkStatusClose(); - WindowBase* ViewClippingOpen(); - WindowBase* TransparencyOpen(); - WindowBase* AssetPacksOpen(); - WindowBase* EditorParkEntranceOpen(); + // ObjectLoadError + WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); - // WC_FINANCES - WindowBase* FinancesOpen(); - WindowBase* FinancesResearchOpen(); - WindowBase* FinancesMarketingOpen(); + // Options + WindowBase* OptionsOpen(); - // WC_PARK_INFORMATION + // Park WindowBase* ParkAwardsOpen(); WindowBase* ParkEntranceOpen(); WindowBase* ParkGuestsOpen(); WindowBase* ParkObjectiveOpen(); WindowBase* ParkRatingOpen(); - WindowBase* BannerOpen(rct_windownumber number); - WindowBase* RideDemolishPromptOpen(const Ride& ride); - WindowBase* RideRefurbishPromptOpen(const Ride& ride); - WindowBase* SignOpen(rct_windownumber number); - WindowBase* SignSmallOpen(rct_windownumber number); + // Player WindowBase* PlayerOpen(uint8_t id); - WindowBase* NewCampaignOpen(int16_t campaignType); - - WindowBase* InstallTrackOpen(const utf8* path); - void WindowGuestListRefreshList(); - WindowBase* GuestListOpen(); - WindowBase* GuestListOpenWithFilter(GuestListFilterType type, int32_t index); - WindowBase* StaffFirePromptOpen(Peep* peep); - WindowBase* ScenarioselectOpen(ScenarioSelectCallback callback); - WindowBase* ScenarioselectOpen(std::function callback); - WindowBase* ErrorOpen(StringId title, StringId message, const class Formatter& formatter, bool autoClose = false); - WindowBase* ErrorOpen(std::string_view title, std::string_view message, bool autoClose = false); - - WindowBase* LoadsaveOpen( - int32_t type, std::string_view defaultPath, std::function callback, - TrackDesign* trackDesign); - void WindowLoadSaveInputKey(WindowBase* w, uint32_t keycode); - void WindowLoadSaveOverwritePromptInputKey(WindowBase* w, uint32_t keycode); - - WindowBase* TrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); - WindowBase* TrackManageOpen(struct TrackDesignFileRef* tdFileRef); + // ProgressWindow + WindowBase* ProgressWindowOpen(const std::string& text, CloseCallback onClose = nullptr); + void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE); + void ProgressWindowClose(); - void TrackPlaceClearProvisionalTemporarily(); - void TrackPlaceRestoreProvisional(); + // PatrolArea + WindowBase* PatrolAreaOpen(EntityId staffId); + EntityId WindowPatrolAreaGetCurrentStaffId(); - WindowBase* MapOpen(); - void WindowMapReset(); + // RefurbishRidePrompt + WindowBase* RideRefurbishPromptOpen(const Ride& ride); + // Research WindowBase* ResearchOpen(); void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); @@ -150,14 +220,7 @@ namespace OpenRCT2::Ui::Windows void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi); - WindowBase* NewRideOpen(); - WindowBase* NewRideOpenResearch(); - void WindowNewRideInitVars(); - void WindowNewRideFocus(RideSelection rideItem); - - WindowBase* RideListOpen(); - void WindowRideListRefreshList(WindowBase* w); - + // Ride WindowBase* RideMainOpen(const Ride& ride); WindowBase* RideOpenTrack(TileElement* tileElement); WindowBase* RideOpenVehicle(Vehicle* vehicle); @@ -165,49 +228,41 @@ namespace OpenRCT2::Ui::Windows void WindowRidePaintResetVehicle(RideId rideIndex); void WindowRideMeasurementsDesignCancel(); - // rct2: 0x00F635EE - extern RideSelection _window_track_list_item; - WindowBase* TrackListOpen(RideSelection item); - void WindowTrackDesignListReloadTracks(); - void WindowTrackDesignListSetBeingUpdated(bool beingUpdated); - - void SetMapTooltip(Formatter& ft); - const Formatter& GetMapTooltip(); - void WindowMapTooltipUpdateVisibility(); - - WindowBase* MazeConstructionOpen(); - void WindowMazeConstructionUpdatePressedWidgets(); - - WindowBase* NetworkStatusOpen(const std::string& text, CloseCallback onClose); - WindowBase* NetworkStatusOpenPassword(); - void WindowNetworkStatusClose(); - - WindowBase* ProgressWindowOpen(const std::string& text, CloseCallback onClose = nullptr); - void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE); - void ProgressWindowClose(); - - void WindowTextInputKey(WindowBase* w, uint32_t keycode); - void WindowTextInputOpen( - WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, - StringId existing_text, uintptr_t existing_args, int32_t maxLength); - void WindowTextInputRawOpen( - WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, - const_utf8string existing_text, int32_t maxLength); - - void WindowTextInputOpen( - std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, - std::function okCallback, std::function cancelCallback); - - WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); - + // RideConstruction WindowBase* RideConstructionOpen(); void WindowRideConstructionUpdateActiveElementsImpl(); void WindowRideConstructionUpdateEnabledTrackPieces(); void RideRestoreProvisionalTrackPiece(); void RideRemoveProvisionalTrackPiece(); + void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); + void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); + void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); + void UpdateGhostTrackAndArrow(); + void WindowRideConstructionKeyboardShortcutTurnLeft(); + void WindowRideConstructionKeyboardShortcutTurnRight(); + void WindowRideConstructionKeyboardShortcutUseTrackDefault(); + void WindowRideConstructionKeyboardShortcutSlopeDown(); + void WindowRideConstructionKeyboardShortcutSlopeUp(); + void WindowRideConstructionKeyboardShortcutChainLiftToggle(); + void WindowRideConstructionKeyboardShortcutBankLeft(); + void WindowRideConstructionKeyboardShortcutBankRight(); + void WindowRideConstructionKeyboardShortcutPreviousTrack(); + void WindowRideConstructionKeyboardShortcutNextTrack(); + void WindowRideConstructionKeyboardShortcutBuildCurrent(); + void WindowRideConstructionKeyboardShortcutDemolishCurrent(); + + // RideList + WindowBase* RideListOpen(); + void WindowRideListRefreshList(WindowBase* w); - WindowBase* TopToolbarOpen(); + // SavePrompt + WindowBase* SavePromptOpen(); + // ScenarioSelect + WindowBase* ScenarioselectOpen(ScenarioSelectCallback callback); + WindowBase* ScenarioselectOpen(std::function callback); + + // Scenery WindowBase* SceneryOpen(); void WindowScenerySetSelectedItem( const ScenerySelection& sceneryconst, std::optional primary, const std::optional secondary, @@ -219,24 +274,103 @@ namespace OpenRCT2::Ui::Windows const ScenerySelection WindowSceneryGetTabSelection(); void ToggleSceneryWindow(); - extern uint8_t gToolbarDirtyFlags; - WindowBase* GameBottomToolbarOpen(); - void WindowGameBottomToolbarInvalidateNewsItem(); + // SceneryScatter + WindowBase* SceneryScatterOpen(); - WindowBase* EditorBottomToolbarOpen(); +#ifndef DISABLE_NETWORK + // ServerList + WindowBase* ServerListOpen(); + + // ServerStart + WindowBase* ServerStartOpen(); +#endif + + // ShortcutKeys + WindowBase* ShortcutKeysOpen(); + + // Sign + WindowBase* SignOpen(rct_windownumber number); + WindowBase* SignSmallOpen(rct_windownumber number); + + // Staff + WindowBase* StaffOpen(Peep* peep); + + // StaffFirePrompt + WindowBase* StaffFirePromptOpen(Peep* peep); + + // StaffList + WindowBase* StaffListOpen(); + void WindowStaffListRefresh(); + + // TextInput + void WindowTextInputKey(WindowBase* w, uint32_t keycode); + void WindowTextInputOpen( + WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + StringId existing_text, uintptr_t existing_args, int32_t maxLength); + void WindowTextInputRawOpen( + WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + const_utf8string existing_text, int32_t maxLength); + void WindowTextInputOpen( + std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, + std::function okCallback, std::function cancelCallback); + + // Themes + WindowBase* ThemesOpen(); + // TileInspector WindowBase* TileInspectorOpen(); void WindowTileInspectorClearClipboard(); + void WindowTileInspectorKeyboardShortcutToggleInvisibility(); - WindowBase* EditorObjectSelectionOpen(); - bool EditorObjectSelectionWindowCheck(); + // TitleExit + WindowBase* TitleExitOpen(); + + // TitleLogo + WindowBase* TitleLogoOpen(); + // TitleMenu + WindowBase* TitleMenuOpen(); + + // TitleOptions + WindowBase* TitleOptionsOpen(); + + // TitleVersion + WindowBase* TitleVersionOpen(); + + // Tooltip void WindowTooltipReset(const ScreenCoordsXY& screenCoords); void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords); void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); void WindowTooltipClose(); - WindowBase* SceneryScatterOpen(); - WindowBase* PatrolAreaOpen(EntityId staffId); - EntityId WindowPatrolAreaGetCurrentStaffId(); + // TopToolbar + WindowBase* TopToolbarOpen(); + + // TrackDesignPlace + WindowBase* TrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); + void TrackPlaceClearProvisionalTemporarily(); + void TrackPlaceRestoreProvisional(); + + // TrackDesignManage + WindowBase* TrackManageOpen(struct TrackDesignFileRef* tdFileRef); + + // TrackList + // rct2: 0x00F635EE + extern RideSelection _window_track_list_item; + WindowBase* TrackListOpen(RideSelection item); + void WindowTrackDesignListReloadTracks(); + void WindowTrackDesignListSetBeingUpdated(bool beingUpdated); + + // Transparency + WindowBase* TransparencyOpen(); + + // ViewClipping + WindowBase* ViewClippingOpen(); + + // Viewport + WindowBase* ViewportOpen(); + + // Water + WindowBase* WaterOpen(); + void ToggleWaterWindow(); } // namespace OpenRCT2::Ui::Windows From bf413b2ab75cb37756039bbfb54f4f3f20b83b4e Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 19 Jan 2025 07:43:26 -0800 Subject: [PATCH 4/8] Booster code cleanups/unified booster speed preparation --- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2/ride/Ride.cpp | 5 ++-- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideData.cpp | 7 +++++ src/openrct2/ride/RideData.h | 5 ++++ src/openrct2/ride/Vehicle.cpp | 27 ++++++++------------ 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 5d300dd4bc24..37a5c44a878f 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1545,7 +1545,7 @@ namespace OpenRCT2::Ui::Windows uint16_t brakeSpeed2 = ((_currentBrakeSpeed * 9) >> 2) & 0xFFFF; if (TrackTypeIsBooster(_selectedTrackType) || TrackTypeIsBooster(_currentlySelectedTrack.trackType)) { - brakeSpeed2 = GetBoosterSpeed(currentRide->type, brakeSpeed2); + brakeSpeed2 = GetUnifiedBoosterSpeed(currentRide->type, brakeSpeed2); } ft.Add(brakeSpeed2); } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index c55117b4d61f..86a2a351bd80 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5463,10 +5463,9 @@ bool RideHasRatings(const Ride& ride) return !ride.ratings.isNull(); } -int32_t GetBoosterSpeed(ride_type_t rideType, int32_t rawSpeed) +int32_t GetUnifiedBoosterSpeed(ride_type_t rideType, int32_t relativeSpeed) { - // BoosterSpeedFactor has valid values of 1, 2, 4 representing a 1/2, 1, and 2 multiplier. - return rawSpeed * GetRideTypeDescriptor(rideType).LegacyBoosterSettings.BoosterSpeedFactor / 2; + return GetRideTypeDescriptor(rideType).GetUnifiedBoosterSpeed(relativeSpeed); } void FixInvalidVehicleSpriteSizes() diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 36b302156b10..25875015069d 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -993,7 +993,7 @@ bool RideHasAdjacentStation(const Ride& ride); bool RideHasStationShelter(const Ride& ride); bool RideHasRatings(const Ride& ride); -int32_t GetBoosterSpeed(ride_type_t rideType, int32_t rawSpeed); +int32_t GetUnifiedBoosterSpeed(ride_type_t rideType, int32_t relativeSpeed); void FixInvalidVehicleSpriteSizes(); bool RideEntryHasCategory(const RideObjectEntry& rideEntry, uint8_t category); diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index e1b828e58a9c..16530ec139c0 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -456,3 +456,10 @@ TrackDrawerEntry getTrackDrawerEntry(const RideTypeDescriptor& rtd, bool isInver return descriptor.Regular; } + +int32_t RideTypeDescriptor::GetUnifiedBoosterSpeed(int32_t compressedSpeed) const +{ + // BoosterSpeedFactor has valid values of 1, 2, 4 representing a 1/2, 1, and 2 multiplier of legacy speed to unified + // speed. + return compressedSpeed * LegacyBoosterSettings.BoosterSpeedFactor / 2; +} diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index f6a41ae808ac..28cfb166ad28 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -536,6 +536,11 @@ struct RideTypeDescriptor bool SupportsTrackGroup(const TrackGroup trackGroup) const; ResearchCategory GetResearchCategory() const; bool SupportsRideMode(RideMode rideMode) const; + /** + * Converts booster speed from the ride type's speed regime (Junior, Default, Giga) to to the unified values used by the + * vehicle. See https://github.com/OpenRCT2/OpenRCT2/discussions/23119 for more information about unified speed. + */ + int32_t GetUnifiedBoosterSpeed(int32_t relativeSpeed) const; }; extern const RideTypeDescriptor RideTypeDescriptors[RIDE_TYPE_COUNT]; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 32ef8bed0bdd..4da220dc4b40 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -79,6 +79,9 @@ constexpr int16_t VEHICLE_MAX_SPIN_SPEED_WATER_RIDE = 512; constexpr int16_t VEHICLE_MIN_SPIN_SPEED_WATER_RIDE = -VEHICLE_MAX_SPIN_SPEED_WATER_RIDE; constexpr int16_t VEHICLE_STOPPING_SPIN_SPEED = 600; +constexpr uint8_t kTrackSpeedShiftAmount = 16; +constexpr uint8_t kBoosterAccelerationShiftAmount = 16; + Vehicle* gCurrentVehicle; static uint8_t _vehicleBreakdown; @@ -5457,7 +5460,7 @@ void Vehicle::ApplyNonStopBlockBrake() velocity = kBlockBrakeBaseSpeed; acceleration = 0; } - else if (velocity > (brake_speed << 16) + kBlockBrakeSpeedOffset) + else if (velocity > (brake_speed << kTrackSpeedShiftAmount) + kBlockBrakeSpeedOffset) { velocity -= velocity >> 4; acceleration = 0; @@ -7108,9 +7111,9 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu && curRide.breakdown_reason_pending == BREAKDOWN_BRAKES_FAILURE; if (!hasBrakesFailure || curRide.mechanic_status == RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { - auto brakeSpeed = ChooseBrakeSpeed(); + auto brakeSpeed = ChooseBrakeSpeed() << kTrackSpeedShiftAmount; - if ((brakeSpeed << 16) < _vehicleVelocityF64E08) + if ((brakeSpeed) < _vehicleVelocityF64E08) { acceleration = -_vehicleVelocityF64E08 * 16; } @@ -7126,11 +7129,11 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu } else if (TrackTypeIsBooster(trackType)) { - auto boosterSpeed = GetBoosterSpeed(curRide.type, (brake_speed << 16)); + auto boosterSpeed = GetUnifiedBoosterSpeed(curRide.type, brake_speed) << kTrackSpeedShiftAmount; if (boosterSpeed > _vehicleVelocityF64E08) { acceleration = GetRideTypeDescriptor(curRide.type).LegacyBoosterSettings.BoosterAcceleration - << 16; //_vehicleVelocityF64E08 * 1.2; + << kBoosterAccelerationShiftAmount; } } else if (rideEntry.flags & RIDE_ENTRY_FLAG_RIDER_CONTROLS_SPEED && num_peeps > 0) @@ -7141,7 +7144,8 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu if ((trackType == TrackElemType::Flat && curRide.GetRideTypeDescriptor().HasFlag(RtdFlag::hasLsmBehaviourOnFlat)) || (trackType == TrackElemType::PoweredLift)) { - acceleration = GetRideTypeDescriptor(curRide.type).LegacyBoosterSettings.PoweredLiftAcceleration << 16; + acceleration = GetRideTypeDescriptor(curRide.type).LegacyBoosterSettings.PoweredLiftAcceleration + << kBoosterAccelerationShiftAmount; } if (trackType == TrackElemType::BrakeForDrop) { @@ -7506,21 +7510,12 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c { auto brakeSpeed = ChooseBrakeSpeed(); - if (-(brakeSpeed << 16) > _vehicleVelocityF64E08) + if (-(brakeSpeed << kTrackSpeedShiftAmount) > _vehicleVelocityF64E08) { acceleration = _vehicleVelocityF64E08 * -16; } } - if (trackType == TrackElemType::Booster) - { - auto boosterSpeed = GetBoosterSpeed(curRide.type, (brake_speed << 16)); - if (boosterSpeed < _vehicleVelocityF64E08) - { - acceleration = GetRideTypeDescriptor(curRide.type).LegacyBoosterSettings.BoosterAcceleration << 16; - } - } - uint16_t newTrackProgress = track_progress - 1; if (newTrackProgress == 0xFFFF) { From be9f27e4f957b360704c3d841334f394230bcd6a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Sun, 19 Jan 2025 16:59:45 +0100 Subject: [PATCH 5/8] Mass rename constants (#23656) --- src/openrct2-ui/CursorData.cpp | 16 +- src/openrct2-ui/TextComposition.cpp | 2 +- src/openrct2-ui/UiContext.cpp | 8 +- src/openrct2-ui/audio/AudioContext.cpp | 4 +- src/openrct2-ui/audio/SDLAudioSource.cpp | 12 +- src/openrct2-ui/audio/WavAudioSource.cpp | 31 +- .../engines/HardwareDisplayDrawingEngine.cpp | 4 +- .../engines/opengl/ApplyPaletteShader.cpp | 4 +- .../opengl/ApplyTransparencyShader.cpp | 4 +- .../drawing/engines/opengl/DrawLineShader.cpp | 4 +- .../drawing/engines/opengl/DrawRectShader.cpp | 4 +- .../engines/opengl/OpenGLDrawingEngine.cpp | 4 +- .../engines/opengl/OpenGLFramebuffer.cpp | 6 +- .../engines/opengl/OpenGLShaderProgram.cpp | 2 +- .../engines/opengl/OpenGLShaderProgram.h | 2 +- .../engines/opengl/SwapFramebuffer.cpp | 14 +- .../drawing/engines/opengl/TextureCache.cpp | 4 +- .../drawing/engines/opengl/TextureCache.h | 8 +- src/openrct2-ui/input/InputManager.cpp | 4 +- src/openrct2-ui/input/MouseInput.cpp | 14 +- src/openrct2-ui/input/ShortcutInput.cpp | 8 +- src/openrct2-ui/input/ShortcutManager.cpp | 28 +- src/openrct2-ui/input/ShortcutManager.h | 2 +- src/openrct2-ui/interface/Dropdown.h | 14 +- src/openrct2-ui/interface/InGameConsole.cpp | 20 +- src/openrct2-ui/interface/InGameConsole.h | 12 +- src/openrct2-ui/interface/LandTool.cpp | 4 +- src/openrct2-ui/interface/Objective.cpp | 2 +- src/openrct2-ui/interface/Theme.cpp | 2 +- .../interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/interface/Widget.cpp | 18 +- src/openrct2-ui/interface/Widget.h | 22 +- src/openrct2-ui/interface/Window.cpp | 4 +- src/openrct2-ui/ride/Construction.h | 2 +- src/openrct2-ui/scripting/CustomImages.cpp | 2 +- src/openrct2-ui/scripting/CustomListView.cpp | 20 +- src/openrct2-ui/scripting/CustomListView.h | 2 +- src/openrct2-ui/scripting/CustomMenu.cpp | 2 +- src/openrct2-ui/scripting/CustomWindow.cpp | 12 +- src/openrct2-ui/scripting/ScUi.hpp | 6 +- src/openrct2-ui/scripting/ScWidget.hpp | 2 +- src/openrct2-ui/windows/About.cpp | 4 +- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2-ui/windows/ClearScenery.cpp | 5 +- src/openrct2-ui/windows/CustomCurrency.cpp | 2 +- src/openrct2-ui/windows/Dropdown.cpp | 14 +- .../windows/EditorBottomToolbar.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 16 +- .../windows/EditorObjectiveOptions.cpp | 28 +- .../windows/EditorParkEntrance.cpp | 4 +- .../windows/EditorScenarioOptions.cpp | 54 +-- src/openrct2-ui/windows/Finances.cpp | 2 +- src/openrct2-ui/windows/Footpath.cpp | 6 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 10 +- src/openrct2-ui/windows/InstallTrack.cpp | 8 +- src/openrct2-ui/windows/Land.cpp | 5 +- src/openrct2-ui/windows/LandRights.cpp | 3 +- src/openrct2-ui/windows/LoadSave.cpp | 17 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapTooltip.cpp | 4 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 2 +- src/openrct2-ui/windows/NetworkStatus.cpp | 2 +- src/openrct2-ui/windows/NewCampaign.cpp | 16 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/Options.cpp | 26 +- src/openrct2-ui/windows/Park.cpp | 4 +- src/openrct2-ui/windows/PatrolArea.cpp | 3 +- src/openrct2-ui/windows/ProgressWindow.cpp | 2 +- src/openrct2-ui/windows/Research.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 62 +-- src/openrct2-ui/windows/RideConstruction.cpp | 6 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/SavePrompt.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 4 +- src/openrct2-ui/windows/Scenery.cpp | 4 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 10 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 4 +- src/openrct2-ui/windows/StaffList.cpp | 6 +- src/openrct2-ui/windows/TextInput.cpp | 14 +- src/openrct2-ui/windows/Themes.cpp | 16 +- src/openrct2-ui/windows/TileInspector.cpp | 8 +- src/openrct2-ui/windows/TitleMenu.cpp | 2 +- src/openrct2-ui/windows/Tooltip.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 26 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 4 +- src/openrct2-ui/windows/Transparency.cpp | 12 +- src/openrct2-ui/windows/ViewClipping.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 2 +- src/openrct2-ui/windows/Water.cpp | 5 +- src/openrct2-ui/windows/Windows.h | 2 +- src/openrct2/Context.cpp | 20 +- src/openrct2/Context.h | 2 +- src/openrct2/Editor.cpp | 6 +- src/openrct2/FileClassifier.cpp | 2 +- src/openrct2/Game.cpp | 2 +- src/openrct2/GameState.h | 2 +- src/openrct2/GameStateSnapshots.cpp | 14 +- src/openrct2/Limits.h | 4 +- src/openrct2/PlatformEnvironment.cpp | 20 +- src/openrct2/PlatformEnvironment.h | 4 +- src/openrct2/Version.cpp | 4 +- src/openrct2/Version.h | 2 +- src/openrct2/actions/BannerRemoveAction.cpp | 12 +- .../actions/BannerSetColourAction.cpp | 2 +- src/openrct2/actions/BannerSetStyleAction.cpp | 4 +- src/openrct2/actions/ClearAction.cpp | 2 +- .../actions/FootpathAdditionPlaceAction.cpp | 2 +- .../actions/FootpathAdditionRemoveAction.cpp | 2 +- src/openrct2/actions/FootpathPlaceAction.cpp | 4 +- src/openrct2/actions/FootpathRemoveAction.cpp | 2 +- src/openrct2/actions/GameAction.h | 4 +- src/openrct2/actions/GameActionRegistry.cpp | 2 +- src/openrct2/actions/GameActionResult.h | 4 +- src/openrct2/actions/GuestSetFlagsAction.cpp | 4 +- src/openrct2/actions/GuestSetNameAction.cpp | 8 +- src/openrct2/actions/LandBuyRightsAction.cpp | 10 +- src/openrct2/actions/LandBuyRightsAction.h | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 24 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.h | 2 +- .../actions/LargeSceneryPlaceAction.cpp | 2 +- .../actions/LargeSceneryRemoveAction.cpp | 2 +- .../actions/LargeScenerySetColourAction.cpp | 6 +- src/openrct2/actions/MazeSetTrackAction.cpp | 14 +- .../actions/ParkEntrancePlaceAction.cpp | 4 +- .../actions/ParkEntranceRemoveAction.cpp | 6 +- .../actions/ParkSetEntranceFeeAction.cpp | 4 +- .../actions/ParkSetParameterAction.cpp | 4 +- src/openrct2/actions/ParkSetParameterAction.h | 6 +- src/openrct2/actions/PeepPickupAction.cpp | 18 +- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 2 +- src/openrct2/actions/ResultWithMessage.h | 4 +- src/openrct2/actions/RideCreateAction.cpp | 6 +- src/openrct2/actions/RideDemolishAction.cpp | 6 +- .../actions/RideEntranceExitRemoveAction.cpp | 4 +- src/openrct2/actions/RideSetPriceAction.cpp | 4 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 14 +- src/openrct2/actions/SignSetNameAction.cpp | 4 +- src/openrct2/actions/SignSetStyleAction.cpp | 12 +- .../actions/SmallScenerySetColourAction.cpp | 2 +- src/openrct2/actions/StaffFireAction.cpp | 6 +- .../actions/StaffSetCostumeAction.cpp | 2 +- src/openrct2/actions/StaffSetNameAction.cpp | 4 +- src/openrct2/actions/StaffSetOrdersAction.cpp | 2 +- src/openrct2/actions/TrackDesignAction.cpp | 4 +- src/openrct2/actions/TrackPlaceAction.cpp | 2 +- .../actions/TrackSetBrakeSpeedAction.cpp | 2 +- src/openrct2/actions/WallPlaceAction.cpp | 6 +- src/openrct2/actions/WallSetColourAction.cpp | 8 +- src/openrct2/actions/WaterSetHeightAction.cpp | 12 +- src/openrct2/audio/Audio.cpp | 6 +- src/openrct2/command_line/CommandLine.cpp | 6 +- src/openrct2/command_line/CommandLine.hpp | 4 +- .../command_line/ParkInfoCommands.cpp | 4 +- src/openrct2/command_line/RootCommands.cpp | 54 +-- .../command_line/ScreenshotCommands.cpp | 26 +- src/openrct2/command_line/SpriteCommands.cpp | 18 +- src/openrct2/core/BitSet.hpp | 80 ++-- src/openrct2/core/ChecksumStream.cpp | 4 +- src/openrct2/core/ChecksumStream.h | 4 +- src/openrct2/core/Compression.cpp | 16 +- src/openrct2/core/Crypt.OpenRCT2.cpp | 12 +- src/openrct2/core/DateTime.h | 2 +- src/openrct2/core/EnumMap.hpp | 8 +- src/openrct2/core/FileIndex.hpp | 6 +- src/openrct2/core/Guard.cpp | 6 +- src/openrct2/core/Http.Android.cpp | 4 +- src/openrct2/core/Http.WinHttp.cpp | 24 +- src/openrct2/core/Http.cURL.cpp | 4 +- src/openrct2/core/Imaging.cpp | 6 +- src/openrct2/core/Json.hpp | 4 +- src/openrct2/core/OrcaStream.hpp | 17 +- src/openrct2/core/RTL.FriBidi.cpp | 8 +- src/openrct2/core/Random.hpp | 8 +- src/openrct2/drawing/Drawing.Sprite.BMP.cpp | 10 +- src/openrct2/drawing/Drawing.Sprite.RLE.cpp | 10 +- src/openrct2/drawing/Drawing.Sprite.cpp | 4 +- src/openrct2/drawing/Drawing.String.cpp | 20 +- src/openrct2/drawing/Drawing.cpp | 10 +- src/openrct2/drawing/Drawing.h | 22 +- src/openrct2/drawing/Font.cpp | 18 +- src/openrct2/drawing/Font.h | 2 +- src/openrct2/drawing/Image.cpp | 26 +- src/openrct2/drawing/ImageId.hpp | 61 +-- src/openrct2/drawing/ImageImporter.cpp | 14 +- src/openrct2/drawing/LightFX.cpp | 41 +- src/openrct2/drawing/NewDrawing.cpp | 12 +- src/openrct2/drawing/ScrollingText.cpp | 170 +++---- src/openrct2/drawing/ScrollingText.h | 4 +- src/openrct2/drawing/Weather.cpp | 24 +- src/openrct2/drawing/Weather.h | 4 +- src/openrct2/drawing/X8DrawingEngine.cpp | 28 +- src/openrct2/drawing/X8DrawingEngine.h | 4 +- src/openrct2/entity/Duck.cpp | 17 +- src/openrct2/entity/EntityRegistry.cpp | 26 +- src/openrct2/entity/EntityRegistry.h | 2 +- src/openrct2/entity/Fountain.cpp | 16 +- src/openrct2/entity/Guest.cpp | 78 ++-- src/openrct2/entity/Guest.h | 2 +- src/openrct2/entity/Litter.cpp | 8 +- src/openrct2/entity/MoneyEffect.cpp | 6 +- src/openrct2/entity/Particle.cpp | 4 +- src/openrct2/entity/PatrolArea.h | 4 +- src/openrct2/entity/Peep.cpp | 24 +- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 24 +- src/openrct2/entity/Yaw.hpp | 6 +- src/openrct2/interface/InteractiveConsole.cpp | 10 +- src/openrct2/interface/Screenshot.cpp | 8 +- src/openrct2/interface/Viewport.cpp | 6 +- src/openrct2/interface/Viewport.h | 2 +- src/openrct2/interface/Widget.h | 2 +- src/openrct2/interface/Window.cpp | 14 +- .../localisation/LocalisationService.cpp | 22 +- src/openrct2/localisation/StringIdType.h | 4 +- src/openrct2/management/Research.cpp | 10 +- src/openrct2/network/NetworkBase.cpp | 31 +- src/openrct2/object/EntranceObject.cpp | 2 +- .../object/FootpathRailingsObject.cpp | 2 +- src/openrct2/object/Object.cpp | 6 +- src/openrct2/object/Object.h | 2 +- src/openrct2/object/ObjectRepository.h | 4 +- src/openrct2/object/RideObject.cpp | 18 +- src/openrct2/object/RideObject.h | 4 +- src/openrct2/object/StationObject.cpp | 4 +- src/openrct2/object/StationObject.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 2 +- .../paint/tile_element/Paint.PathAddition.cpp | 6 +- .../coaster/ClassicStandUpRollerCoaster.cpp | 6 +- .../coaster/ClassicWoodenRollerCoaster.cpp | 82 ++-- .../coaster/SideFrictionRollerCoaster.cpp | 4 +- .../track/coaster/WoodenRollerCoaster.hpp | 236 +++++----- src/openrct2/paint/vehicle/VehiclePaint.cpp | 4 +- src/openrct2/park/ParkFile.cpp | 12 +- src/openrct2/park/ParkFile.h | 8 +- src/openrct2/peep/GuestPathfinding.cpp | 6 +- src/openrct2/platform/Crash.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/DATLimits.h | 8 +- src/openrct2/rct2/RCT2.h | 10 +- src/openrct2/rct2/S6Importer.cpp | 6 +- src/openrct2/ride/Ride.cpp | 12 +- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideData.h | 4 +- src/openrct2/ride/RideEntry.h | 6 +- src/openrct2/ride/ShopItem.cpp | 8 +- src/openrct2/ride/TrackData.cpp | 440 +++++++++--------- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/ride/TrackPaint.cpp | 2 +- src/openrct2/scenario/ScenarioRepository.cpp | 4 +- src/openrct2/scripting/ScriptEngine.cpp | 6 +- src/openrct2/scripting/ScriptEngine.h | 10 +- .../scripting/bindings/entity/ScEntity.hpp | 4 +- .../scripting/bindings/game/ScContext.hpp | 4 +- .../scripting/bindings/network/ScNetwork.cpp | 8 +- .../scripting/bindings/world/ScMap.cpp | 4 +- src/openrct2/sprites.h | 4 +- src/openrct2/world/ConstructionClearance.cpp | 8 +- src/openrct2/world/Footpath.cpp | 4 +- src/openrct2/world/Location.hpp | 4 +- src/openrct2/world/TileInspector.cpp | 2 +- 270 files changed, 1635 insertions(+), 1639 deletions(-) diff --git a/src/openrct2-ui/CursorData.cpp b/src/openrct2-ui/CursorData.cpp index 425061a91a17..1e583e7c76e8 100644 --- a/src/openrct2-ui/CursorData.cpp +++ b/src/openrct2-ui/CursorData.cpp @@ -15,9 +15,9 @@ namespace OpenRCT2::Ui { - constexpr char rawTransparent = ' '; - constexpr char rawWhite = '.'; - constexpr char rawBlack = 'X'; + constexpr char kRawTransparent = ' '; + constexpr char kRawWhite = '.'; + constexpr char kRawBlack = 'X'; constexpr static CursorData cursorFromBitMap(int x, int y, std::string_view bitmap) { @@ -35,15 +35,15 @@ namespace OpenRCT2::Ui uint8_t dataBit{}, maskBit{}; switch (rawPixel) { - case rawBlack: + case kRawBlack: dataBit = 1; maskBit = 1; break; - case rawWhite: + case kRawWhite: dataBit = 0; maskBit = 1; break; - case rawTransparent: + case kRawTransparent: dataBit = 0; maskBit = 0; break; @@ -947,7 +947,7 @@ namespace OpenRCT2::Ui " X.X " " X "); - static constexpr const CursorData* RawCursorData[] = { + static constexpr const CursorData* kRawCursorData[] = { nullptr, // CursorID::Arrow &kBlankCursorData, // CursorID::Blank &kUpArrowCursorData, // CursorID::UpArrow @@ -983,7 +983,7 @@ namespace OpenRCT2::Ui const CursorData* result = nullptr; if (cursorId != CursorID::Undefined && cursorId != CursorID::Count) { - result = RawCursorData[EnumValue(cursorId)]; + result = kRawCursorData[EnumValue(cursorId)]; } return result; } diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 789fc979c31e..19be2b7c797c 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -172,7 +172,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) if ((modifier & KEYBOARD_PRIMARY_MODIFIER) && _session.Length) { SDL_SetClipboardText(_session.Buffer->c_str()); - ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, STR_NONE, {}); + ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, kStringIdNone, {}); } break; case SDLK_v: diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index e19194a05934..f7938e6a92e5 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -63,7 +63,7 @@ using namespace OpenRCT2::Ui; class UiContext final : public IUiContext { private: - constexpr static uint32_t TOUCH_DOUBLE_TIMEOUT = 300; + constexpr static uint32_t kTouchDoubleTimeout = 300; const std::unique_ptr _platformUiContext; const std::unique_ptr _windowManager; @@ -176,12 +176,12 @@ class UiContext final : public IUiContext void SetFullscreenMode(FULLSCREEN_MODE mode) override { - static constexpr int32_t _sdlFullscreenFlags[] = { + static constexpr int32_t kSDLFullscreenFlags[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP, }; - uint32_t windowFlags = _sdlFullscreenFlags[EnumValue(mode)]; + uint32_t windowFlags = kSDLFullscreenFlags[EnumValue(mode)]; // HACK Changing window size when in fullscreen usually has no effect if (mode == FULLSCREEN_MODE::FULLSCREEN) @@ -475,7 +475,7 @@ class UiContext final : public IUiContext _cursorState.touchIsDouble = (!_cursorState.touchIsDouble - && e.tfinger.timestamp - _cursorState.touchDownTimestamp < TOUCH_DOUBLE_TIMEOUT); + && e.tfinger.timestamp - _cursorState.touchDownTimestamp < kTouchDoubleTimeout); if (_cursorState.touchIsDouble) { diff --git a/src/openrct2-ui/audio/AudioContext.cpp b/src/openrct2-ui/audio/AudioContext.cpp index 17ad6e709f85..e20ffc5f8acb 100644 --- a/src/openrct2-ui/audio/AudioContext.cpp +++ b/src/openrct2-ui/audio/AudioContext.cpp @@ -25,7 +25,7 @@ namespace OpenRCT2::Audio class AudioContext final : public IAudioContext { private: - static constexpr size_t STREAM_MIN_SIZE = 2 * 1024 * 1024; // 2 MiB + static constexpr size_t kStreamMinSize = 2 * 1024 * 1024; // 2 MiB std::unique_ptr _audioMixer; @@ -110,7 +110,7 @@ namespace OpenRCT2::Audio // Load whole stream into memory if small enough auto dataLength = source->GetLength(); - if (dataLength < STREAM_MIN_SIZE) + if (dataLength < kStreamMinSize) { auto& targetFormat = _audioMixer->GetFormat(); source = source->ToMemory(targetFormat); diff --git a/src/openrct2-ui/audio/SDLAudioSource.cpp b/src/openrct2-ui/audio/SDLAudioSource.cpp index 340566d9a524..ca267a3b8d82 100644 --- a/src/openrct2-ui/audio/SDLAudioSource.cpp +++ b/src/openrct2-ui/audio/SDLAudioSource.cpp @@ -80,20 +80,20 @@ std::unique_ptr SDLAudioSource::ToMemory(const AudioFormat& targ static AudioCodecKind GetAudioCodec(SDL_RWops* rw) { - constexpr uint32_t MAGIC_FLAC = 0x43614C66; - constexpr uint32_t MAGIC_OGG = 0x5367674F; - constexpr uint32_t MAGIC_RIFF = 0x46464952; + constexpr uint32_t kMagicFLAC = 0x43614C66; + constexpr uint32_t kMagicOGG = 0x5367674F; + constexpr uint32_t kMagicRIFF = 0x46464952; auto originalPosition = SDL_RWtell(rw); auto magic = SDL_ReadLE32(rw); SDL_RWseek(rw, originalPosition, RW_SEEK_SET); switch (magic) { - case MAGIC_FLAC: + case kMagicFLAC: return AudioCodecKind::Flac; - case MAGIC_OGG: + case kMagicOGG: return AudioCodecKind::Ogg; - case MAGIC_RIFF: + case kMagicRIFF: return AudioCodecKind::Wav; default: return AudioCodecKind::Unknown; diff --git a/src/openrct2-ui/audio/WavAudioSource.cpp b/src/openrct2-ui/audio/WavAudioSource.cpp index a3ada6322f01..5b6e12ff8b6d 100644 --- a/src/openrct2-ui/audio/WavAudioSource.cpp +++ b/src/openrct2-ui/audio/WavAudioSource.cpp @@ -20,11 +20,11 @@ namespace OpenRCT2::Audio class WavAudioSource final : public SDLAudioSource { private: - static constexpr uint32_t DATA = 0x61746164; - static constexpr uint32_t FMT = 0x20746D66; - static constexpr uint32_t RIFF = 0x46464952; - static constexpr uint32_t WAVE = 0x45564157; - static constexpr uint16_t pcmformat = 0x0001; + static constexpr uint32_t kChunkIdDATA = 0x61746164; + static constexpr uint32_t kChunkIdFMT = 0x20746D66; + static constexpr uint32_t kChunkIdRIFF = 0x46464952; + static constexpr uint32_t kChunkIdWAVE = 0x45564157; + static constexpr uint16_t kPCMFormat = 0x0001; SDL_RWops* _rw{}; AudioFormat _format = {}; @@ -36,7 +36,7 @@ namespace OpenRCT2::Audio : _rw(rw) { auto chunkId = SDL_ReadLE32(rw); - if (chunkId != RIFF) + if (chunkId != kChunkIdRIFF) { SDL_RWclose(rw); throw std::runtime_error("Not a WAV file"); @@ -45,13 +45,13 @@ namespace OpenRCT2::Audio // Read and discard chunk size SDL_ReadLE32(rw); auto chunkFormat = SDL_ReadLE32(rw); - if (chunkFormat != WAVE) + if (chunkFormat != kChunkIdWAVE) { SDL_RWclose(rw); throw std::runtime_error("Not in WAVE format"); } - auto fmtChunkSize = FindChunk(rw, FMT); + auto fmtChunkSize = FindChunk(rw, kChunkIdFMT); if (!fmtChunkSize) { SDL_RWclose(rw); @@ -61,7 +61,7 @@ namespace OpenRCT2::Audio auto chunkStart = SDL_RWtell(rw); auto encoding = SDL_ReadLE16(rw); - if (encoding != pcmformat) + if (encoding != kPCMFormat) { SDL_RWclose(rw); throw std::runtime_error("Not in PCM format"); @@ -87,7 +87,7 @@ namespace OpenRCT2::Audio SDL_RWseek(rw, chunkStart + fmtChunkSize, RW_SEEK_SET); - auto dataChunkSize = FindChunk(rw, DATA); + auto dataChunkSize = FindChunk(rw, kChunkIdDATA); if (dataChunkSize == 0) { SDL_RWclose(rw); @@ -155,11 +155,12 @@ namespace OpenRCT2::Audio { return subchunkSize; } - constexpr uint32_t FACT = 0x74636166; - constexpr uint32_t LIST = 0x5453494c; - constexpr uint32_t BEXT = 0x74786562; - constexpr uint32_t JUNK = 0x4B4E554A; - while (subchunkId == FACT || subchunkId == LIST || subchunkId == BEXT || subchunkId == JUNK) + constexpr uint32_t kChunkIdFACT = 0x74636166; + constexpr uint32_t kChunkIdLIST = 0x5453494c; + constexpr uint32_t kChunkIdBEXT = 0x74786562; + constexpr uint32_t kChunkIdJUNK = 0x4B4E554A; + while (subchunkId == kChunkIdFACT || subchunkId == kChunkIdLIST || subchunkId == kChunkIdBEXT + || subchunkId == kChunkIdJUNK) { SDL_RWseek(rw, subchunkSize, RW_SEEK_CUR); subchunkId = SDL_ReadLE32(rw); diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 6b0d7f4d8df6..d5ba5cfb5bf2 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -30,7 +30,7 @@ using namespace OpenRCT2::Ui; class HardwareDisplayDrawingEngine final : public X8DrawingEngine { private: - constexpr static uint32_t DIRTY_VISUAL_TIME = 32; + constexpr static uint32_t kDirtyVisualTime = 32; std::shared_ptr const _uiContext; SDL_Window* _window = nullptr; @@ -223,7 +223,7 @@ class HardwareDisplayDrawingEngine final : public X8DrawingEngine { for (uint32_t y = top; y < bottom; y++) { - SetDirtyVisualTime(x, y, DIRTY_VISUAL_TIME); + SetDirtyVisualTime(x, y, kDirtyVisualTime); } } } diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp index 466335775715..16d2758d56ec 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { -1.0f, -1.0f, 0.0f, 0.0f }, { 1.0f, -1.0f, 1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f, 1.0f }, @@ -38,7 +38,7 @@ ApplyPaletteShader::ApplyPaletteShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp index 14b9032439b5..3d4201ecee20 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { -1.0f, -1.0f, 0.0f, 0.0f }, { 1.0f, -1.0f, 1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f, 1.0f }, @@ -38,7 +38,7 @@ ApplyTransparencyShader::ApplyTransparencyShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp index 07f2aa8ba5e4..b3a47c9f16e9 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp @@ -23,7 +23,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[2] = { +constexpr VDStruct kVertexData[2] = { { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }, }; @@ -38,7 +38,7 @@ DrawLineShader::DrawLineShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp index 4de36de76052..f9217295afe3 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }, { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, @@ -42,7 +42,7 @@ DrawRectShader::DrawRectShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 6c460950157f..52951d795fbb 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -47,7 +47,7 @@ struct OpenGLVersion GLint Minor; }; -constexpr OpenGLVersion OPENGL_MINIMUM_REQUIRED_VERSION = { 3, 3 }; +constexpr OpenGLVersion kOpenGLMinimumRequiredVersion = { 3, 3 }; constexpr uint8_t kCSInside = 0b0000; constexpr uint8_t kCSLeft = 0b0001; @@ -216,7 +216,7 @@ class OpenGLDrawingEngine final : public IDrawingEngine void Initialise() override { - OpenGLVersion requiredVersion = OPENGL_MINIMUM_REQUIRED_VERSION; + OpenGLVersion requiredVersion = kOpenGLMinimumRequiredVersion; SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, requiredVersion.Major); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, requiredVersion.Minor); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp index 445c0613a183..b9f86f065401 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp @@ -18,11 +18,11 @@ using namespace OpenRCT2::Ui; -constexpr GLuint BACKBUFFER_ID = 0; +constexpr GLuint kBackBufferID = 0; OpenGLFramebuffer::OpenGLFramebuffer(SDL_Window* window) { - _id = BACKBUFFER_ID; + _id = kBackBufferID; _texture = 0; _depth = 0; SDL_GL_GetDrawableSize(window, &_width, &_height); @@ -65,7 +65,7 @@ OpenGLFramebuffer::OpenGLFramebuffer(int32_t width, int32_t height, bool depth, OpenGLFramebuffer::~OpenGLFramebuffer() { - if (_id != BACKBUFFER_ID) + if (_id != kBackBufferID) { glDeleteTextures(1, &_texture); glDeleteTextures(1, &_depth); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index 74a5db8141f6..88001df5723d 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -77,7 +77,7 @@ std::string OpenGLShader::ReadSourceCode(const std::string& path) auto fs = FileStream(path, FILE_MODE_OPEN); uint64_t fileLength = fs.GetLength(); - if (fileLength > MaxSourceSize) + if (fileLength > kMaxSourceSize) { throw IOException("Shader source too large."); } diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h index 167bcb75f52d..2537e75c88ef 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Ui class OpenGLShader final { private: - static constexpr uint64_t MaxSourceSize = 8 * 1024 * 1024; // 8 MiB + static constexpr uint64_t kMaxSourceSize = 8 * 1024 * 1024; // 8 MiB GLenum _type; GLuint _id = 0; diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp index 86ebfbe54862..3a85b1a6e890 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp @@ -15,9 +15,9 @@ using namespace OpenRCT2::Ui; -constexpr GLfloat depthValue[1] = { 1.0f }; -constexpr GLfloat depthValueTransparent[1] = { 0.0f }; -constexpr GLuint indexValue[4] = { 0, 0, 0, 0 }; +constexpr GLfloat kDepthValue[1] = { 1.0f }; +constexpr GLfloat kDepthValueTransparent[1] = { 0.0f }; +constexpr GLuint kIndexValue[4] = { 0, 0, 0, 0 }; SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) : _opaqueFramebuffer(width, height) @@ -26,7 +26,7 @@ SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) , _backDepth(OpenGLFramebuffer::CreateDepthTexture(width, height)) { _transparentFramebuffer.Bind(); - glClearBufferfv(GL_DEPTH, 0, depthValueTransparent); + glClearBufferfv(GL_DEPTH, 0, kDepthValueTransparent); } SwapFramebuffer::~SwapFramebuffer() @@ -48,8 +48,8 @@ void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint // Clear transparency buffers _transparentFramebuffer.Bind(); - glClearBufferuiv(GL_COLOR, 0, indexValue); - glClearBufferfv(GL_DEPTH, 0, depthValueTransparent); + glClearBufferuiv(GL_COLOR, 0, kIndexValue); + glClearBufferfv(GL_DEPTH, 0, kDepthValueTransparent); _opaqueFramebuffer.SwapColourBuffer(_mixFramebuffer); // Change binding to guarantee no undefined behavior @@ -59,7 +59,7 @@ void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint void SwapFramebuffer::Clear() { _opaqueFramebuffer.Bind(); - glClearBufferfv(GL_DEPTH, 0, depthValue); + glClearBufferfv(GL_DEPTH, 0, kDepthValue); } #endif /* DISABLE_OPENGL */ diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index 64a3b55ea711..9d65a7114921 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -175,9 +175,9 @@ void TextureCache::CreateTextures() { // Determine width and height to use for texture atlases glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_atlasesTextureDimensions); - if (_atlasesTextureDimensions > TEXTURE_CACHE_MAX_ATLAS_SIZE) + if (_atlasesTextureDimensions > kTextureCacheMaxAtlasSize) { - _atlasesTextureDimensions = TEXTURE_CACHE_MAX_ATLAS_SIZE; + _atlasesTextureDimensions = kTextureCacheMaxAtlasSize; } // Determine maximum number of atlases (minimum of size and array limit) diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index 9e3772a1fc35..1a1b4561dcfd 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -54,11 +54,11 @@ namespace OpenRCT2::Ui // This is the maximum width and height of each atlas, basically the // granularity at which new atlases are allocated (2048 -> 4 MB of VRAM) - constexpr int32_t TEXTURE_CACHE_MAX_ATLAS_SIZE = 2048; + constexpr int32_t kTextureCacheMaxAtlasSize = 2048; // Pixel dimensions of smallest supported slots in texture atlases // Must be a power of 2! - constexpr int32_t TEXTURE_CACHE_SMALLEST_SLOT = 32; + constexpr int32_t kTextureCacheSmallestSlot = 32; struct BasicTextureInfo { @@ -155,9 +155,9 @@ namespace OpenRCT2::Ui { int32_t actualSize = std::max(actualWidth, actualHeight); - if (actualSize < TEXTURE_CACHE_SMALLEST_SLOT) + if (actualSize < kTextureCacheSmallestSlot) { - actualSize = TEXTURE_CACHE_SMALLEST_SLOT; + actualSize = kTextureCacheSmallestSlot; } return static_cast(ceil(log2f(static_cast(actualSize)))); diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 13de6798b270..d9d652f8651c 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -81,10 +81,10 @@ void InputManager::QueueInputEvent(InputEvent&& e) void InputManager::CheckJoysticks() { - constexpr uint32_t CHECK_INTERVAL_MS = 5000; + constexpr uint32_t kCheckInternalMs = 5000; auto tick = SDL_GetTicks(); - if (tick > _lastJoystickCheck + CHECK_INTERVAL_MS) + if (tick > _lastJoystickCheck + kCheckInternalMs) { _lastJoystickCheck = tick; diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 2a6087a2d81b..f4d64b15a33d 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1142,7 +1142,7 @@ namespace OpenRCT2 { CursorID cursorId = CursorID::Arrow; auto ft = Formatter(); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); SetMapTooltip(ft); auto* windowMgr = GetWindowManager(); @@ -1348,16 +1348,16 @@ namespace OpenRCT2 if (_clickRepeatTicks.has_value()) { // The initial amount of time in ticks to wait until the first click repeat. - constexpr auto ticksUntilRepeats = 16U; + constexpr auto kTicksUntilRepeats = 16u; // The amount of ticks between each click repeat. - constexpr auto eventDelayInTicks = 3U; + constexpr auto kEventDelayInTicks = 3u; // The amount of ticks since the last click repeat. const auto clickRepeatsDelta = gCurrentRealTimeTicks - _clickRepeatTicks.value(); // Handle click repeat, only start this when at least 16 ticks elapsed. - if (clickRepeatsDelta >= ticksUntilRepeats && (clickRepeatsDelta & eventDelayInTicks) == 0) + if (clickRepeatsDelta >= kTicksUntilRepeats && (clickRepeatsDelta & kEventDelayInTicks) == 0) { if (WidgetIsHoldable(*w, widgetIndex)) { @@ -1365,7 +1365,7 @@ namespace OpenRCT2 } // Subtract initial delay from here on we want the event each third tick. - _clickRepeatTicks = gCurrentRealTimeTicks - ticksUntilRepeats; + _clickRepeatTicks = gCurrentRealTimeTicks - kTicksUntilRepeats; } } @@ -1397,7 +1397,7 @@ namespace OpenRCT2 { dropdown_index = DropdownIndexFromPoint(screenCoords, w); dropdownCleanup = dropdown_index == -1 - || (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) + || (dropdown_index < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) || gDropdownItems[dropdown_index].IsSeparator(); w = nullptr; // To be closed right next } @@ -1531,7 +1531,7 @@ namespace OpenRCT2 OpenRCT2String{ kColourToTip.at(ColourDropDownIndexToColour(dropdown_index)), {} }, screenCoords); } - if (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) + if (dropdown_index < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) { return; } diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 21b8906aff6e..f49fe84bd679 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -20,7 +20,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; -constexpr uint32_t UsefulModifiers = KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GUI; +constexpr uint32_t kUsefulModifiers = KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GUI; static uint32_t ParseModifier(std::string_view text) { @@ -202,7 +202,7 @@ std::string_view ShortcutInput::GetModifierName(uint32_t key, bool localised) auto r = _keys.find(key); if (r != _keys.end()) { - if (localised && r->second.second != STR_NONE) + if (localised && r->second.second != kStringIdNone) { return LanguageGetString(r->second.second); } @@ -379,7 +379,7 @@ static bool HasModifier(uint32_t shortcut, uint32_t actual, uint32_t left, uint3 static bool CompareModifiers(uint32_t shortcut, uint32_t actual) { - shortcut &= UsefulModifiers; + shortcut &= kUsefulModifiers; return HasModifier(shortcut, actual, KMOD_LCTRL, KMOD_RCTRL) && HasModifier(shortcut, actual, KMOD_LSHIFT, KMOD_RSHIFT) && HasModifier(shortcut, actual, KMOD_LALT, KMOD_RALT) && HasModifier(shortcut, actual, KMOD_LGUI, KMOD_RGUI); } @@ -399,7 +399,7 @@ bool ShortcutInput::Matches(const InputEvent& e) const std::optional ShortcutInput::FromInputEvent(const InputEvent& e) { // Assume any side modifier (more specific configurations can be done by manually editing config file) - auto modifiers = e.Modifiers & UsefulModifiers; + auto modifiers = e.Modifiers & kUsefulModifiers; for (auto mod : { KMOD_CTRL, KMOD_SHIFT, KMOD_ALT, KMOD_GUI }) { if (modifiers & mod) diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index 99562b707c0d..b1423f7316fa 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -227,26 +227,26 @@ void ShortcutManager::LoadUserBindings() std::optional ShortcutManager::ConvertLegacyBinding(uint16_t binding) { - constexpr uint16_t nullBinding = 0xFFFF; - constexpr uint16_t shift = 0x100; - constexpr uint16_t ctrl = 0x200; - constexpr uint16_t alt = 0x400; - constexpr uint16_t cmd = 0x800; + constexpr uint16_t kNullBinding = 0xFFFF; + constexpr uint16_t kShift = 0x100; + constexpr uint16_t kCtrl = 0x200; + constexpr uint16_t kAlt = 0x400; + constexpr uint16_t kCmd = 0x800; - if (binding == nullBinding) + if (binding == kNullBinding) { return std::nullopt; } ShortcutInput result; result.Kind = InputDeviceKind::Keyboard; - if (binding & shift) + if (binding & kShift) result.Modifiers |= KMOD_SHIFT; - if (binding & ctrl) + if (binding & kCtrl) result.Modifiers |= KMOD_CTRL; - if (binding & alt) + if (binding & kAlt) result.Modifiers |= KMOD_ALT; - if (binding & cmd) + if (binding & kCmd) result.Modifiers |= KMOD_GUI; result.Button = SDL_GetKeyFromScancode(static_cast(binding & 0xFF)); return result; @@ -254,14 +254,14 @@ std::optional ShortcutManager::ConvertLegacyBinding(uint16_t bind void ShortcutManager::LoadLegacyBindings(const fs::path& path) { - constexpr int32_t SUPPORTED_FILE_VERSION = 1; - constexpr int32_t MAX_LEGACY_SHORTCUTS = 85; + constexpr int32_t kSupportedFileVersion = 1; + constexpr int32_t kMaxLegacyShortcuts = 85; auto fs = FileStream(path, FILE_MODE_OPEN); auto version = fs.ReadValue(); - if (version == SUPPORTED_FILE_VERSION) + if (version == kSupportedFileVersion) { - for (size_t i = 0; i < MAX_LEGACY_SHORTCUTS; i++) + for (size_t i = 0; i < kMaxLegacyShortcuts; i++) { auto value = fs.ReadValue(); auto shortcutId = GetLegacyShortcutId(i); diff --git a/src/openrct2-ui/input/ShortcutManager.h b/src/openrct2-ui/input/ShortcutManager.h index 52066f4c963c..bbe6d9442d91 100644 --- a/src/openrct2-ui/input/ShortcutManager.h +++ b/src/openrct2-ui/input/ShortcutManager.h @@ -57,7 +57,7 @@ namespace OpenRCT2::Ui { public: std::string Id; - StringId LocalisedName = STR_NONE; + StringId LocalisedName = kStringIdNone; std::string CustomName; std::vector Default; std::vector Current; diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index d80f3f7c162b..dda8577925ce 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -18,10 +18,10 @@ namespace OpenRCT2::Dropdown { struct Item; - constexpr StringId SeparatorString = 0; - constexpr StringId FormatColourPicker = 0xFFFE; - constexpr StringId FormatLandPicker = 0xFFFF; - constexpr int32_t ItemsMaxSize = 512; + constexpr StringId kSeparatorString = 0; + constexpr StringId kFormatColourPicker = 0xFFFE; + constexpr StringId kFormatLandPicker = 0xFFFF; + constexpr int32_t kItemsMaxSize = 512; enum Flag { @@ -39,7 +39,7 @@ namespace OpenRCT2::Dropdown namespace OpenRCT2::Ui::Windows { extern int32_t gDropdownNumItems; - extern Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; + extern Dropdown::Item gDropdownItems[Dropdown::kItemsMaxSize]; extern bool gDropdownIsColour; extern int32_t gDropdownLastColourHover; extern int32_t gDropdownHighlightedIndex; @@ -81,7 +81,7 @@ namespace OpenRCT2::Dropdown constexpr bool IsSeparator() const { - return Format == SeparatorString; + return Format == kSeparatorString; } constexpr bool IsDisabled() const @@ -116,7 +116,7 @@ namespace OpenRCT2::Dropdown constexpr ItemExt Separator() { - return ItemExt(-1, Dropdown::SeparatorString, STR_EMPTY); + return ItemExt(-1, Dropdown::kSeparatorString, kStringIdEmpty); } template diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 470bf79a2793..4074de17c6e5 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -41,7 +41,7 @@ static int32_t InGameConsoleGetLineHeight() void InGameConsole::WriteInitial() { - InteractiveConsole::WriteLine(OPENRCT2_NAME " " OPENRCT2_VERSION); + InteractiveConsole::WriteLine(OPENRCT2_NAME " " kOpenRCT2Version); InteractiveConsole::WriteLine(LanguageGetString(STR_CONSOLE_HELPER_TEXT)); InteractiveConsole::WriteLine(""); WritePrompt(); @@ -135,13 +135,13 @@ void InGameConsole::ClearInput() _consoleCurrentLine.clear(); if (_isOpen) { - _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, CONSOLE_INPUT_SIZE); + _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, kConsoleInputSize); } } void InGameConsole::HistoryAdd(const u8string& src) { - if (_consoleHistory.size() >= CONSOLE_HISTORY_SIZE) + if (_consoleHistory.size() >= kConsoleHistorySize) { _consoleHistory.pop_front(); } @@ -201,7 +201,7 @@ void InGameConsole::Open() _isOpen = true; ScrollToEnd(); RefreshCaret(); - _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, CONSOLE_INPUT_SIZE); + _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, kConsoleInputSize); } void InGameConsole::Close() @@ -242,9 +242,9 @@ void InGameConsole::WriteLine(const std::string& input, FormatToken colourFormat stringOffset = splitPos + 1; } - if (_consoleLines.size() > CONSOLE_MAX_LINES) + if (_consoleLines.size() > kConsoleMaxLines) { - const std::size_t linesToErase = _consoleLines.size() - CONSOLE_MAX_LINES; + const std::size_t linesToErase = _consoleLines.size() - kConsoleMaxLines; _consoleLines.erase(_consoleLines.begin(), _consoleLines.begin() + linesToErase); } } @@ -323,7 +323,7 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const INSET_RECT_FLAG_BORDER_INSET); std::string lineBuffer; - auto screenCoords = _consoleTopLeft + ScreenCoordsXY{ CONSOLE_EDGE_PADDING, CONSOLE_EDGE_PADDING }; + auto screenCoords = _consoleTopLeft + ScreenCoordsXY{ kConsoleEdgePadding, kConsoleEdgePadding }; // Draw text inside console for (std::size_t i = 0; i < _consoleLines.size() && i < static_cast(maxLines); i++) @@ -353,7 +353,7 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const screenCoords.y += lineHeight; } - screenCoords.y = _consoleBottomRight.y - lineHeight - CONSOLE_EDGE_PADDING - 1; + screenCoords.y = _consoleBottomRight.y - lineHeight - kConsoleEdgePadding - 1; // Draw current line if (textColour.colour == COLOUR_BLACK) @@ -367,11 +367,11 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const } // Draw caret - if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD) + if (_consoleCaretTicks < kConsoleCaretFlashThreshold) { auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight }; uint8_t caretColour = ColourMapA[textColour.colour].lightest; - GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour); + GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ kConsoleCaretWidth, 1 } }, caretColour); } // What about border colours? diff --git a/src/openrct2-ui/interface/InGameConsole.h b/src/openrct2-ui/interface/InGameConsole.h index 31497b9a6c1a..e0d3b6b6bfd6 100644 --- a/src/openrct2-ui/interface/InGameConsole.h +++ b/src/openrct2-ui/interface/InGameConsole.h @@ -21,12 +21,12 @@ namespace OpenRCT2::Ui class InGameConsole final : public InteractiveConsole { private: - static constexpr int32_t CONSOLE_MAX_LINES = 300; - static constexpr int32_t CONSOLE_HISTORY_SIZE = 64; - static constexpr int32_t CONSOLE_INPUT_SIZE = 256; - static constexpr int32_t CONSOLE_CARET_FLASH_THRESHOLD = 15; - static constexpr int32_t CONSOLE_EDGE_PADDING = 4; - static constexpr int32_t CONSOLE_CARET_WIDTH = 6; + static constexpr int32_t kConsoleMaxLines = 300; + static constexpr int32_t kConsoleHistorySize = 64; + static constexpr int32_t kConsoleInputSize = 256; + static constexpr int32_t kConsoleCaretFlashThreshold = 15; + static constexpr int32_t kConsoleEdgePadding = 4; + static constexpr int32_t kConsoleCaretWidth = 6; bool _isInitialised = false; bool _isOpen = false; diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 661168ebbbf1..8c9c3c165eea 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -68,7 +68,7 @@ void LandTool::ShowSurfaceStyleDropdown(WindowBase* w, Widget* widget, ObjectEnt if (surfaceObj->Colour != TerrainSurfaceObject::kNoValue) imageId = imageId.WithPrimary(surfaceObj->Colour); - gDropdownItems[itemIndex].Format = Dropdown::FormatLandPicker; + gDropdownItems[itemIndex].Format = Dropdown::kFormatLandPicker; Dropdown::SetImage(itemIndex, imageId); if (i == currentSurfaceType) { @@ -118,7 +118,7 @@ void LandTool::ShowEdgeStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryI // If fallback images are loaded, the RCT1 styles will just look like copies of already existing styles, so hide them. if (edgeObj != nullptr && !edgeObj->UsesFallbackImages()) { - gDropdownItems[itemIndex].Format = Dropdown::FormatLandPicker; + gDropdownItems[itemIndex].Format = Dropdown::kFormatLandPicker; Dropdown::SetImage(itemIndex, ImageId(edgeObj->IconImageId)); if (i == currentEdgeType) { diff --git a/src/openrct2-ui/interface/Objective.cpp b/src/openrct2-ui/interface/Objective.cpp index 702fea5992b5..fa161be18486 100644 --- a/src/openrct2-ui/interface/Objective.cpp +++ b/src/openrct2-ui/interface/Objective.cpp @@ -37,7 +37,7 @@ namespace OpenRCT2::Ui { if (objective.Type == OBJECTIVE_BUILD_THE_BEST) { - StringId rideTypeString = STR_NONE; + StringId rideTypeString = kStringIdNone; auto rideTypeId = objective.RideId; if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) { diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 28dd7d732814..62bcf66c3fc3 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -896,7 +896,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc); if (desc == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return desc->WindowName; } diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 75b866915250..0b5c1df1ebd5 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -506,7 +506,7 @@ namespace OpenRCT2::Ui { ft.Add(STR_BROKEN); } - ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : STR_NONE); + ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : kStringIdNone); SetMapTooltip(ft); return info; } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 17fe15838782..52002e0389de 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -227,7 +227,7 @@ namespace OpenRCT2::Ui // Get the widget auto& widget = w.widgets[widgetIndex]; - if (widget.type != WindowWidgetType::Tab && widget.image.GetIndex() == ImageIndexUndefined) + if (widget.type != WindowWidgetType::Tab && widget.image.GetIndex() == kImageIndexUndefined) return; if (widget.type == WindowWidgetType::Tab) @@ -235,7 +235,7 @@ namespace OpenRCT2::Ui if (WidgetIsDisabled(w, widgetIndex)) return; - if (widget.image.GetIndex() == ImageIndexUndefined) + if (widget.image.GetIndex() == kImageIndexUndefined) { // Set standard tab sprite to use. widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); @@ -346,7 +346,7 @@ namespace OpenRCT2::Ui // Get the widget const auto& widget = w.widgets[widgetIndex]; - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; auto colour = w.colours[widget.colour]; @@ -391,7 +391,7 @@ namespace OpenRCT2::Ui // Get the widget const auto& widget = w.widgets[widgetIndex]; - if (widget.text == STR_NONE || widget.content == kWidgetContentEmpty) + if (widget.text == kStringIdNone || widget.content == kWidgetContentEmpty) return; auto colour = w.colours[widget.colour]; @@ -457,7 +457,7 @@ namespace OpenRCT2::Ui { if (widget.string == nullptr || widget.string[0] == '\0') { - stringId = STR_NONE; + stringId = kStringIdNone; formatArgs = nullptr; } else @@ -485,7 +485,7 @@ namespace OpenRCT2::Ui // Text auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget); - if (stringId != STR_NONE) + if (stringId != kStringIdNone) { auto colour = w.colours[widget.colour].withFlag(ColourFlag::translucent, false); if (WidgetIsDisabled(w, widgetIndex)) @@ -561,7 +561,7 @@ namespace OpenRCT2::Ui FilterPaletteID::PaletteDarken3); // Draw text - if (widget->text == STR_NONE) + if (widget->text == kStringIdNone) return; topLeft = w.windowPos + ScreenCoordsXY{ widget->left + 2, widget->top + 1 }; @@ -606,7 +606,7 @@ namespace OpenRCT2::Ui // Draw the button GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press); - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; topLeft = w.windowPos + ScreenCoordsXY{ widget.midX() - 1, std::max(widget.top, widget.midY() - 5) }; @@ -652,7 +652,7 @@ namespace OpenRCT2::Ui } // draw the text - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget); diff --git a/src/openrct2-ui/interface/Widget.h b/src/openrct2-ui/interface/Widget.h index 1442f79f1f4d..1404c9108a33 100644 --- a/src/openrct2-ui/interface/Widget.h +++ b/src/openrct2-ui/interface/Widget.h @@ -19,7 +19,7 @@ namespace OpenRCT2::Ui { // clang-format off #define WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, CLOSE_STR) \ - { WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, STR_NONE }, \ + { WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, kStringIdNone }, \ { WindowWidgetType::Caption, 0, 1, WIDTH - 2, 1, 14, TITLE, STR_WINDOW_TITLE_TIP }, \ { WindowWidgetType::CloseBox, 0, WIDTH - 13, WIDTH - 3, 2, 13, CLOSE_STR, STR_CLOSE_WINDOW_TIP } @@ -52,7 +52,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, - uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { Widget out = {}; out.left = origin.x; @@ -69,7 +69,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageId image, - StringId tooltip = STR_NONE) + StringId tooltip = kStringIdNone) { Widget out = {}; out.left = origin.x; @@ -86,17 +86,17 @@ namespace OpenRCT2::Ui constexpr Widget MakeRemapWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageIndex content, - StringId tooltip = STR_NONE) + StringId tooltip = kStringIdNone) { return MakeWidget(origin, size, type, colour, ImageId(content, FilterPaletteID::PaletteNull), tooltip); } - constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = STR_NONE) + constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = kStringIdNone) { const ScreenSize size = kTabSize; const WindowWidgetType type = WindowWidgetType::Tab; const WindowColour colour = WindowColour::Secondary; - const auto content = ImageId(ImageIndexUndefined); + const auto content = ImageId(kImageIndexUndefined); return MakeWidget(origin, size, type, colour, content, tooltip); } @@ -113,7 +113,7 @@ namespace OpenRCT2::Ui out.type = WindowWidgetType::ProgressBar; out.colour = colour; out.content = 0 | (lowerBlinkBound << 8) | (upperBlinkBound << 16); - out.tooltip = STR_NONE; + out.tooltip = kStringIdNone; return out; } @@ -125,7 +125,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeSpinnerDecreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 26; const int16_t yPos = origin.y + 1; @@ -137,7 +137,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeSpinnerIncreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 13; const int16_t yPos = origin.y + 1; @@ -152,14 +152,14 @@ namespace OpenRCT2::Ui constexpr Widget MakeDropdownBoxWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { return MakeWidget(origin, size, type, colour, content); } constexpr Widget MakeDropdownButtonWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 11; const int16_t yPos = origin.y + 1; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 82a567b29f5c..48376cecd8b5 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -37,7 +37,7 @@ namespace OpenRCT2 using namespace OpenRCT2::Ui; // The amount of pixels to scroll per wheel click - constexpr int32_t WindowScrollPixels = 17; + constexpr int32_t kWindowScrollPixels = 17; static int32_t _previousAbsoluteWheel = 0; @@ -259,7 +259,7 @@ namespace OpenRCT2 auto cursorState = ContextGetCursorState(); int32_t absolute_wheel = cursorState->wheel; int32_t relative_wheel = absolute_wheel - _previousAbsoluteWheel; - int32_t pixel_scroll = relative_wheel * WindowScrollPixels; + int32_t pixel_scroll = relative_wheel * kWindowScrollPixels; _previousAbsoluteWheel = absolute_wheel; if (relative_wheel == 0) diff --git a/src/openrct2-ui/ride/Construction.h b/src/openrct2-ui/ride/Construction.h index 519704e59fbd..93dd609d797e 100644 --- a/src/openrct2-ui/ride/Construction.h +++ b/src/openrct2-ui/ride/Construction.h @@ -145,7 +145,7 @@ namespace OpenRCT2 TrackElemType::RightFlyerLargeHalfLoopInvertedUp, TrackElemType::RightFlyerLargeHalfLoopUninvertedDown, }; - constexpr size_t DropdownLength = DropdownOrder.size(); + constexpr size_t kDropdownLength = DropdownOrder.size(); // Update the magic number with the current number of track elements to silence static_assert(EnumValue(TrackElemType::Count) == 349, "Reminder to add new track element to special dropdown list"); diff --git a/src/openrct2-ui/scripting/CustomImages.cpp b/src/openrct2-ui/scripting/CustomImages.cpp index d66456854f91..5cd5d65ef5ca 100644 --- a/src/openrct2-ui/scripting/CustomImages.cpp +++ b/src/openrct2-ui/scripting/CustomImages.cpp @@ -83,7 +83,7 @@ namespace OpenRCT2::Scripting images.resize(count); auto base = GfxObjectAllocateImages(images.data(), count); - if (base == ImageIndexUndefined) + if (base == kImageIndexUndefined) { return {}; } diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 5039e8162d17..cb74e26c76e7 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -26,7 +26,7 @@ using namespace OpenRCT2::Ui::Windows; namespace OpenRCT2::Scripting { - constexpr size_t COLUMN_HEADER_HEIGHT = kListRowHeight + 1; + constexpr size_t kColumnHeaderHeight = kListRowHeight + 1; template<> ColumnSortOrder FromDuk(const DukValue& d) @@ -431,7 +431,7 @@ ScreenSize CustomListView::GetSize() result.height = static_cast(Items.size() * kListRowHeight); if (ShowColumnHeaders) { - result.height += COLUMN_HEADER_HEIGHT; + result.height += kColumnHeaderHeight; } } @@ -472,7 +472,7 @@ void CustomListView::MouseOver(const ScreenCoordsXY& pos, bool isMouseDown) HighlightedCell = hitResult; if (HighlightedCell != LastHighlightedCell) { - if (hitResult->Row != HEADER_ROW && OnHighlight.context() != nullptr && OnHighlight.is_function()) + if (hitResult->Row != kHeaderRow && OnHighlight.context() != nullptr && OnHighlight.is_function()) { auto ctx = OnHighlight.context(); duk_push_int(ctx, static_cast(HighlightedCell->Row)); @@ -489,7 +489,7 @@ void CustomListView::MouseOver(const ScreenCoordsXY& pos, bool isMouseDown) // Update the header currently held down if (isMouseDown) { - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { ColumnHeaderPressedCurrentState = (hitResult->Column == ColumnHeaderPressed); Invalidate(); @@ -511,7 +511,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) auto hitResult = GetItemIndexAt(pos); if (hitResult) { - if (hitResult->Row != HEADER_ROW) + if (hitResult->Row != kHeaderRow) { if (CanSelect) { @@ -531,7 +531,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) } } } - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { if (Columns[hitResult->Column].CanSort) { @@ -546,7 +546,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) void CustomListView::MouseUp(const ScreenCoordsXY& pos) { auto hitResult = GetItemIndexAt(pos); - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { if (hitResult->Column == ColumnHeaderPressed) { @@ -566,7 +566,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollArea* auto paletteIndex = ColourMapA[w->colours[1].colour].mid_light; GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, paletteIndex); - int32_t y = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0; + int32_t y = ShowColumnHeaders ? kColumnHeaderHeight : 0; for (size_t i = 0; i < Items.size(); i++) { if (y > dpi.y + dpi.height) @@ -787,12 +787,12 @@ std::optional CustomListView::GetItemIndexAt(const ScreenCoordsXY& po if (ShowColumnHeaders && absoluteY >= 0 && absoluteY < kListRowHeight) { result = RowColumn(); - result->Row = HEADER_ROW; + result->Row = kHeaderRow; } else { // Check what row we pressed - int32_t firstY = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0; + int32_t firstY = ShowColumnHeaders ? kColumnHeaderHeight : 0; int32_t row = (pos.y - firstY) / kListRowHeight; if (row >= 0 && row < static_cast(Items.size())) { diff --git a/src/openrct2-ui/scripting/CustomListView.h b/src/openrct2-ui/scripting/CustomListView.h index b28a7fa13f77..f02268bb9cde 100644 --- a/src/openrct2-ui/scripting/CustomListView.h +++ b/src/openrct2-ui/scripting/CustomListView.h @@ -94,7 +94,7 @@ namespace OpenRCT2::Ui::Windows class CustomListView { private: - static constexpr int32_t HEADER_ROW = -1; + static constexpr int32_t kHeaderRow = -1; WindowBase* ParentWindow{}; size_t ScrollIndex{}; diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index d085254a9962..207157c8f40a 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -259,7 +259,7 @@ namespace OpenRCT2::Scripting } else { - customTool.Filter = ViewportInteractionItemAll; + customTool.Filter = kViewportInteractionItemAll; } customTool.onStart = dukValue["onStart"]; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index ff5d1605e54c..41e308b78b46 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -641,7 +641,7 @@ namespace OpenRCT2::Ui::Windows widget--; auto selectedIndex = widgetDesc->SelectedIndex; const auto& items = widgetDesc->Items; - const auto numItems = std::min(items.size(), Dropdown::ItemsMaxSize); + const auto numItems = std::min(items.size(), Dropdown::kItemsMaxSize); for (size_t i = 0; i < numItems; i++) { gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; @@ -901,7 +901,7 @@ namespace OpenRCT2::Ui::Windows widget.top = 17; widget.bottom = 43; widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; widgetList.push_back(widget); _info.WidgetIndexMap.push_back(std::numeric_limits::max()); } @@ -958,7 +958,7 @@ namespace OpenRCT2::Ui::Windows widget.right = desc.X + desc.Width - 1; widget.bottom = desc.Y + desc.Height - 1; widget.content = std::numeric_limits::max(); - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; widget.sztooltip = const_cast(desc.Tooltip.c_str()); widget.flags |= WIDGET_FLAGS::TOOLTIP_IS_STRING; if (desc.IsDisabled) @@ -1030,7 +1030,7 @@ namespace OpenRCT2::Ui::Windows widget.top = desc.Y + 1; widget.bottom = desc.Y + desc.Height - 2; widget.text = STR_DROPDOWN_GLYPH; - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; if (desc.IsDisabled) widget.flags |= WIDGET_FLAGS::IS_DISABLED; widgetList.push_back(widget); @@ -1081,7 +1081,7 @@ namespace OpenRCT2::Ui::Windows widget.top = desc.Y + 1; widget.bottom = desc.Y + desc.Height - 2; widget.text = STR_NUMERIC_UP; - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; if (desc.IsDisabled) widget.flags |= WIDGET_FLAGS::IS_DISABLED; widget.flags |= WIDGET_FLAGS::IS_HOLDABLE; @@ -1103,7 +1103,7 @@ namespace OpenRCT2::Ui::Windows else if (desc.Type == "viewport") { widget.type = WindowWidgetType::Viewport; - widget.text = STR_NONE; + widget.text = kStringIdNone; widgetList.push_back(widget); } } diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 4c38829832c2..de18125a4a7f 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -238,15 +238,15 @@ namespace OpenRCT2::Scripting { try { - constexpr int32_t MaxLengthAllowed = 4096; + constexpr int32_t kMaxLengthAllowed = 4096; auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin(); auto title = desc["title"].as_string(); auto description = desc["description"].as_string(); auto initialValue = AsOrDefault(desc["initialValue"], ""); - auto maxLength = AsOrDefault(desc["maxLength"], MaxLengthAllowed); + auto maxLength = AsOrDefault(desc["maxLength"], kMaxLengthAllowed); auto callback = desc["callback"]; WindowTextInputOpen( - title, description, initialValue, std::clamp(maxLength, 0, MaxLengthAllowed), + title, description, initialValue, std::clamp(maxLength, 0, kMaxLengthAllowed), [this, plugin, callback](std::string_view value) { auto dukValue = ToDuk(_scriptEngine.GetContext(), value); _scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false); diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 46478fd8d05d..bdc06796fd31 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -506,7 +506,7 @@ namespace OpenRCT2::Scripting auto widget = GetWidget(); if (widget != nullptr && (widget->type == WindowWidgetType::FlatBtn || widget->type == WindowWidgetType::ImgBtn)) { - if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + if (GetTargetAPIVersion() <= kApiVersionG2Reorder) { return LegacyIconIndex(widget->image.GetIndex()); } diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 7724b10b5434..276ddb897239 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -66,8 +66,8 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget _windowAboutOpenRCT2Widgets[] = { WIDGETS_MAIN, MakeWidget({10, 60}, {WW - 20, 20}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION), // Introduction - MakeWidget({30, 90}, {128, 128}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_NONE), // OpenRCT2 Logo - MakeWidget({168, 100}, {173, 24}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_NONE), // Build version + MakeWidget({30, 90}, {128, 128}, WindowWidgetType::Placeholder, WindowColour::Secondary, kStringIdNone), // OpenRCT2 Logo + MakeWidget({168, 100}, {173, 24}, WindowWidgetType::Placeholder, WindowColour::Secondary, kStringIdNone), // Build version MakeWidget({344, 100 }, {24, 24}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_COPY), STR_COPY_BUILD_HASH ), // "Copy build info" button MakeWidget({168, 115 + 20}, {200, 14}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_UPDATE_AVAILABLE ), // "new version" button MakeWidget({168, 115 + 40}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGELOG_ELLIPSIS), // changelog button diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index f27abb9144b1..f019929dc406 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -348,7 +348,7 @@ static constexpr Widget window_cheats_weather_widgets[] = { MAIN_CHEATS_WIDGETS, MakeWidget ({ 5, 48}, {238, 50}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group - MakeWidget ({126, 62}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather + MakeWidget ({126, 62}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather MakeWidget ({225, 63}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather MakeWidget ({ 11, 80}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP), // Freeze weather MakeWidget ({ 5, 102}, {238, 37}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_FAUNA ), // Fauna group diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 95b838b64678..2346f2e29906 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -47,7 +47,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget( { 27, 17 }, { 44, 32 }, WindowWidgetType::ImgBtn, WindowColour::Primary, SPR_LAND_TOOL_SIZE_0, - STR_NONE), // preview box + kStringIdNone), // preview box MakeRemapWidget( { 28, 18 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size @@ -104,7 +104,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - TextInputOpen(WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + TextInputOpen( + WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); break; } case WIDX_SMALL_SCENERY: diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index c5882a165129..1ddf539031eb 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -43,7 +43,7 @@ namespace OpenRCT2::Ui::Windows static Widget window_custom_currency_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeSpinnerWidgets({100, 30}, {101, 11}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_CURRENCY_FORMAT), // NB: 3 widgets - MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_EMPTY ), + MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, kStringIdEmpty ), MakeWidget ({220, 50}, {131, 11}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget ({339, 51}, { 11, 9}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), }; diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 80ddfec2efb8..0190089edf3e 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -47,8 +47,8 @@ namespace OpenRCT2::Ui::Windows }; int32_t gDropdownNumItems; - Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; - static ImageId _dropdownItemsImages[Dropdown::ItemsMaxSize]; + Dropdown::Item gDropdownItems[Dropdown::kItemsMaxSize]; + static ImageId _dropdownItemsImages[Dropdown::kItemsMaxSize]; bool gDropdownIsColour; int32_t gDropdownLastColourHover; int32_t gDropdownHighlightedIndex; @@ -141,26 +141,26 @@ namespace OpenRCT2::Ui::Windows } StringId item = gDropdownItems[i].Format; - if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) + if (item == Dropdown::kFormatLandPicker || item == Dropdown::kFormatColourPicker) { // Image item auto image = UseImages ? _dropdownItemsImages[i] : ImageId(static_cast(gDropdownItems[i].Args)); - if (item == Dropdown::FormatColourPicker && highlightedIndex == i) + if (item == Dropdown::kFormatColourPicker && highlightedIndex == i) image = image.WithIndexOffset(1); GfxDrawSprite(dpi, image, screenCoords); } else { // Text item - if (i < Dropdown::ItemsMaxSize && Dropdown::IsChecked(i)) + if (i < Dropdown::kItemsMaxSize && Dropdown::IsChecked(i)) item++; // Calculate colour ColourWithFlags colour = { colours[0].colour }; if (i == highlightedIndex) colour.colour = COLOUR_WHITE; - if (i < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(i)) + if (i < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(i)) colour = { colours[0].colour, EnumToFlag(ColourFlag::inset) }; // Draw item string @@ -513,7 +513,7 @@ static constexpr colour_t kColoursDropdownOrder[] = { auto imageId = (orderedColour == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_WHITE) : ImageId(SPR_PALETTE_BTN, orderedColour); - gDropdownItems[i].Format = Dropdown::FormatColourPicker; + gDropdownItems[i].Format = Dropdown::kFormatColourPicker; Dropdown::SetImage(i, imageId); } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 518be08b6692..27d34cd24be4 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -105,7 +105,7 @@ namespace OpenRCT2::Ui::Windows } else if (!(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)) { - if (GetNumFreeEntities() != MAX_ENTITIES || GetGameState().Park.Flags & PARK_FLAGS_SPRITES_INITIALISED) + if (GetNumFreeEntities() != kMaxEntities || GetGameState().Park.Flags & PARK_FLAGS_SPRITES_INITIALISED) { HidePreviousStepButton(); } @@ -141,7 +141,7 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex == WIDX_PREVIOUS_STEP_BUTTON) { if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - || (GetNumFreeEntities() == MAX_ENTITIES && !(gameState.Park.Flags & PARK_FLAGS_SPRITES_INITIALISED))) + || (GetNumFreeEntities() == kMaxEntities && !(gameState.Park.Flags & PARK_FLAGS_SPRITES_INITIALISED))) { ((this)->*(_previousButtonMouseUp[EnumValue(gameState.EditorStep)]))(); } diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index e53405712b69..d38d0153899d 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -523,7 +523,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[DDIX_FILTER_SEPARATOR].Format = 0; gDropdownItems[DDIX_FILTER_SELECTED].Format = STR_TOGGLE_OPTION; gDropdownItems[DDIX_FILTER_NONSELECTED].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_SEPARATOR].Args = STR_NONE; + gDropdownItems[DDIX_FILTER_SEPARATOR].Args = kStringIdNone; gDropdownItems[DDIX_FILTER_SELECTED].Args = STR_SELECTED_ONLY; gDropdownItems[DDIX_FILTER_NONSELECTED].Args = STR_NON_SELECTED_ONLY; } @@ -960,7 +960,7 @@ namespace OpenRCT2::Ui::Windows const auto numSubTabs = static_cast(currentPage.subTabs.size()); for (int8_t i = 0; i <= 6; i++) { - widgets[WIDX_SUB_TAB_0 + i].tooltip = i < numSubTabs ? currentPage.subTabs[i].tooltip : STR_NONE; + widgets[WIDX_SUB_TAB_0 + i].tooltip = i < numSubTabs ? currentPage.subTabs[i].tooltip : kStringIdNone; widgets[WIDX_SUB_TAB_0 + i].type = i < numSubTabs ? WindowWidgetType::Tab : WindowWidgetType::Empty; pressed_widgets &= ~(1uLL << (WIDX_SUB_TAB_0 + i)); } @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); auto stringId = _listSortType == RIDE_SORT_TYPE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; + : kStringIdNone; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 }; DrawTextEllipsised(dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] }); @@ -1095,7 +1095,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); auto stringId = _listSortType == RIDE_SORT_RIDE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; + : kStringIdNone; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 }; DrawTextEllipsised(dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); @@ -1528,7 +1528,7 @@ namespace OpenRCT2::Ui::Windows if (item->Type == ObjectType::Ride) { ride_type_t rideType = 0; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { if (item->RideInfo.RideType[i] != RIDE_TYPE_NULL) { @@ -1665,8 +1665,8 @@ namespace OpenRCT2::Ui::Windows static StringId GetRideTypeStringId(const ObjectRepositoryItem* item) { - StringId result = STR_NONE; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + StringId result = kStringIdNone; + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto rideType = item->RideInfo.RideType[i]; if (rideType != RIDE_TYPE_NULL) @@ -1732,7 +1732,7 @@ namespace OpenRCT2::Ui::Windows LoadPalette(); } if (showFallbackWarning) - ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); + ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, kStringIdEmpty, Formatter::Common()); } bool EditorObjectSelectionWindowCheck() diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 8b3a7ffdfe93..fb019a519dcc 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -120,13 +120,13 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget window_editor_objective_options_main_widgets[] = { MAIN_OBJECTIVE_OPTIONS_WIDGETS, - MakeWidget ({ 98, 48}, {344, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), + MakeWidget ({ 98, 48}, {344, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), MakeWidget ({430, 49}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), MakeSpinnerWidgets({158, 65}, {120, 12}, WindowWidgetType::Button, WindowColour::Secondary ), // NB: 3 widgets MakeSpinnerWidgets({158, 82}, {120, 12}, WindowWidgetType::Button, WindowColour::Secondary ), // NB: 3 widgets MakeWidget ({370, 99}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_NAME_OF_PARK_TIP ), MakeWidget ({370, 116}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_NAME_OF_SCENARIO_TIP ), - MakeWidget ({ 98, 133}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), + MakeWidget ({ 98, 133}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), MakeWidget ({266, 134}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), MakeWidget ({370, 150}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_DETAIL_NOTES_ABOUT_PARK_SCENARIO_TIP), }; @@ -493,7 +493,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyLoanAndValueMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -504,7 +504,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyFoodMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -515,7 +515,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gameState.ScenarioObjective.MinimumLength >= ObjectiveLengthMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -526,7 +526,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gameState.ScenarioObjective.MinimumExcitement >= ObjectiveExcitementMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -537,7 +537,7 @@ namespace OpenRCT2::Ui::Windows default: if (gameState.ScenarioObjective.NumGuests >= ObjectiveGuestsMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -558,7 +558,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyLoanAndValueMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -569,7 +569,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyFoodMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -580,7 +580,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gameState.ScenarioObjective.MinimumLength <= ObjectiveLengthMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -591,7 +591,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gameState.ScenarioObjective.MinimumExcitement <= ObjectiveExcitementMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -602,7 +602,7 @@ namespace OpenRCT2::Ui::Windows default: if (gameState.ScenarioObjective.NumGuests <= ObjectiveGuestsMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -618,7 +618,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = GetGameState(); if (gameState.ScenarioObjective.Year >= ObjectiveYearMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -632,7 +632,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = GetGameState(); if (gameState.ScenarioObjective.Year <= ObjectiveYearMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 8eb06b64792b..fe7bb598816c 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -40,7 +40,7 @@ namespace OpenRCT2::Ui::Windows struct EntranceSelection { ObjectEntryIndex entryIndex = OBJECT_ENTRY_INDEX_NULL; - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; ImageIndex imageId = kSpriteIdNull; }; @@ -61,7 +61,7 @@ namespace OpenRCT2::Ui::Windows static Widget _widgets[] = { WINDOW_SHIM(kWindowTitle, kWindowWidth, kWindowHeight), MakeWidget ({ 0, 43 }, { kWindowWidth, kWindowHeight - 43 }, WindowWidgetType::Resize, WindowColour::Secondary ), - MakeTab ({ 3, 17 }, STR_NONE ), + MakeTab ({ 3, 17 }, kStringIdNone ), MakeWidget ({ 2, 45 }, { kScrollWidth, kScrollHeight }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), MakeWidget ({ kWindowWidth - 26, 59 }, { 24, 24 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 ), }; diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 617ac2810b2a..76edebfcebfc 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -51,7 +51,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT }; - static constexpr StringId ClimateNames[] = { + static constexpr StringId kClimateNames[] = { STR_CLIMATE_COOL_AND_WET, STR_CLIMATE_WARM, STR_CLIMATE_HOT_AND_DRY, @@ -161,10 +161,10 @@ namespace OpenRCT2::Ui::Windows MakeRemapWidget ({ 65, 17}, { 31, 27}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB, STR_SCENARIO_OPTIONS_PARK_TIP ), MakeSpinnerWidgets({188, 48}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets MakeSpinnerWidgets({188, 65}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets - MakeWidget ({ 8, 82}, { 210, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), + MakeWidget ({ 8, 82}, { 210, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), MakeWidget ({206, 83}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), MakeSpinnerWidgets({328, 82}, { 67, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets - MakeWidget ({188, 99}, { 207, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_CLIMATE_TIP ), + MakeWidget ({188, 99}, { 207, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_CLIMATE_TIP ), MakeWidget ({383, 100}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_CLIMATE_TIP ), MakeWidget ({ 8, 116}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_TREE_REMOVAL, STR_FORBID_TREE_REMOVAL_TIP ), MakeWidget ({ 8, 133}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_LANDSCAPE_CHANGES, STR_FORBID_LANDSCAPE_CHANGES_TIP ), @@ -417,7 +417,7 @@ namespace OpenRCT2::Ui::Windows for (i = 0; i < static_cast(ClimateType::Count); i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ClimateNames[i]; + gDropdownItems[i].Args = kClimateNames[i]; } WindowDropdownShowTextCustomWidth( { windowPos.x + dropdownWidget.left, windowPos.y + dropdownWidget.top }, dropdownWidget.height() + 1, @@ -439,7 +439,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_CASH, kStringIdNone, {}); } Invalidate(); break; @@ -452,7 +452,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_CASH, kStringIdNone, {}); } Invalidate(); break; @@ -465,7 +465,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INIT_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -478,7 +478,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INIT_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -491,7 +491,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_MAX_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -504,7 +504,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_MAX_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -517,7 +517,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, kStringIdNone, {}); } Invalidate(); break; @@ -530,7 +530,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, kStringIdNone, {}); } Invalidate(); break; @@ -718,7 +718,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -731,7 +731,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -744,7 +744,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -757,7 +757,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -770,7 +770,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -783,7 +783,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -796,7 +796,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -809,7 +809,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -992,7 +992,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1005,7 +1005,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1018,7 +1018,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1031,7 +1031,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1044,7 +1044,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1057,7 +1057,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1246,7 +1246,7 @@ namespace OpenRCT2::Ui::Windows // Climate value screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); - ft.Add(ClimateNames[EnumValue(gameState.Climate)]); + ft.Add(kClimateNames[EnumValue(gameState.Climate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 6992a2bdc86d..beb778155e96 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -722,7 +722,7 @@ namespace OpenRCT2::Ui::Windows } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index fdf03440450f..1c9f2ceafa52 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -705,7 +705,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numPathTypes; } - gDropdownItems[numPathTypes].Format = STR_NONE; + gDropdownItems[numPathTypes].Format = kStringIdNone; Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); numPathTypes++; @@ -730,7 +730,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numPathTypes; } - gDropdownItems[numPathTypes].Format = STR_NONE; + gDropdownItems[numPathTypes].Format = kStringIdNone; Dropdown::SetImage( numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); _dropdownEntries.push_back({ ObjectType::Paths, i }); @@ -764,7 +764,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numRailingsTypes; } - gDropdownItems[numRailingsTypes].Format = STR_NONE; + gDropdownItems[numRailingsTypes].Format = kStringIdNone; Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); numRailingsTypes++; diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 4a33c57e4adb..e04f0e39ac3c 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -352,7 +352,7 @@ namespace OpenRCT2::Ui::Windows StringId stringId; auto ft = GetMapTooltip(); std::memcpy(&stringId, ft.Data(), sizeof(StringId)); - if (stringId == STR_NONE) + if (stringId == kStringIdNone) { // TODO: this string probably shouldn't be reused for this DrawTextWrapped( diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 15e5f9d15f50..53ebb8b8f842 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -950,7 +950,7 @@ namespace OpenRCT2::Ui::Windows gPickupPeepImage = ImageId(); - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + auto info = GetMapCoordinatesFromPos(screenCoords, kViewportInteractionItemAll); if (info.interactionType == ViewportInteractionItem::None) return; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 31b15cf3391e..4b36ad2bccfa 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -223,7 +223,7 @@ namespace OpenRCT2::Ui::Windows auto guestRide = GetRide(RideId::FromUnderlying(index)); if (guestRide != nullptr) { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); guestRide->FormatNameTo(ft); _selectedFilter = GuestFilterType::GuestsThinking; @@ -459,7 +459,7 @@ namespace OpenRCT2::Ui::Windows { if (_selectedFilter) { - if (_filterArguments.GetFirstStringId() != STR_NONE) + if (_filterArguments.GetFirstStringId() != kStringIdNone) { format = GetFilterString(*_selectedFilter); } @@ -808,9 +808,9 @@ namespace OpenRCT2::Ui::Windows { auto guestViewType = _selectedFilter == GuestFilterType::Guests ? GuestViewType::Actions : GuestViewType::Thoughts; auto peepArgs = GetArgumentsFromPeep(peep, guestViewType); - if (_filterArguments.GetFirstStringId() == STR_NONE && _selectedFilter == GuestFilterType::GuestsThinking) + if (_filterArguments.GetFirstStringId() == kStringIdNone && _selectedFilter == GuestFilterType::GuestsThinking) { - Formatter(peepArgs.args).Add(STR_NONE); + Formatter(peepArgs.args).Add(kStringIdNone); } return _filterArguments == peepArgs; } @@ -865,7 +865,7 @@ namespace OpenRCT2::Ui::Windows // Remove empty group (basically guests with no thoughts) auto foundGroup = std::find_if(std::begin(_groups), std::end(_groups), [](GuestGroup& group) { - return group.Arguments.GetFirstStringId() == STR_EMPTY; + return group.Arguments.GetFirstStringId() == kStringIdEmpty; }); if (foundGroup != std::end(_groups)) { diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 91eb196d9fb8..2eb95ef92ee6 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -372,7 +372,7 @@ namespace OpenRCT2::Ui::Windows if (!Path::CreateDirectory(destPath)) { LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return; } @@ -381,7 +381,7 @@ namespace OpenRCT2::Ui::Windows if (File::Exists(destPath)) { LOG_INFO("%s already exists, prompting user for a different track design name", destPath.c_str()); - ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, kStringIdNone, {}); WindowTextInputRawOpen( this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, {}, _trackName.c_str(), 255); @@ -394,7 +394,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); } } } @@ -405,7 +405,7 @@ namespace OpenRCT2::Ui::Windows auto trackDesign = TrackDesignImport(path); if (trackDesign == nullptr) { - ContextShowError(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOAD_FILE, kStringIdNone, {}); return nullptr; } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index e0975597edc7..0637b3ce13d2 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({19, 19}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_ENABLE_MOUNTAIN_TOOL_TIP), // mountain mode MakeWidget ({55, 19}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PAINTBRUSH), STR_DISABLE_ELEVATION), // paint mode - MakeWidget ({27, 48}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), STR_NONE), // preview box + MakeWidget ({27, 48}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box MakeRemapWidget({28, 49}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size MakeRemapWidget({54, 63}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP), // increment size MakeWidget ({ 2, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP), // floor texture @@ -82,7 +82,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } public: diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 19bee0c291b2..0af72313507b 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -580,7 +580,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } }; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index a356701ea171..a0339a1fc20e 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -82,7 +82,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_loadsave_widgets[] = { - WINDOW_SHIM(STR_NONE, WW, WH), + WINDOW_SHIM(kStringIdNone, WW, WH), MakeWidget({ 0, 15 }, { WW, WH - 15 }, WindowWidgetType::Resize, WindowColour::Secondary ), // WIDX_RESIZE MakeWidget({ 4, 36 }, { 84, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_LOADSAVE_DEFAULT, STR_LOADSAVE_DEFAULT_TIP), // WIDX_DEFAULT MakeWidget({ 88, 36 }, { 84, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_FILEBROWSER_ACTION_UP ), // WIDX_UP @@ -284,7 +284,7 @@ namespace OpenRCT2::Ui::Windows { if (!IsValidPath(path)) { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); return; } @@ -444,7 +444,7 @@ namespace OpenRCT2::Ui::Windows { OpenRCT2::Ui::FileDialogDesc desc = {}; u8string extension; - StringId title = STR_NONE; + StringId title = kStringIdNone; switch (_type & 0x0E) { case LOADSAVETYPE_GAME: @@ -923,7 +923,7 @@ namespace OpenRCT2::Ui::Windows const auto drawButtonCaption = [dpi, this]( Widget& widget, StringId strId, FileBrowserSort ascSort, FileBrowserSort descSort) { - StringId indicatorId = STR_NONE; + StringId indicatorId = kStringIdNone; if (Config::Get().general.LoadSaveSort == ascSort) indicatorId = STR_UP; else if (Config::Get().general.LoadSaveSort == descSort) @@ -974,12 +974,13 @@ namespace OpenRCT2::Ui::Windows case WIDX_NEW_FILE: WindowTextInputOpen( - this, WIDX_NEW_FILE, STR_NONE, STR_FILEBROWSER_FILE_NAME_PROMPT, {}, STR_STRING, + this, WIDX_NEW_FILE, kStringIdNone, STR_FILEBROWSER_FILE_NAME_PROMPT, {}, STR_STRING, reinterpret_cast(_defaultPath.c_str()), 64); break; case WIDX_NEW_FOLDER: - WindowTextInputRawOpen(this, WIDX_NEW_FOLDER, STR_NONE, STR_FILEBROWSER_FOLDER_NAME_PROMPT, {}, "", 64); + WindowTextInputRawOpen( + this, WIDX_NEW_FOLDER, kStringIdNone, STR_FILEBROWSER_FOLDER_NAME_PROMPT, {}, "", 64); break; case WIDX_BROWSE: @@ -1121,7 +1122,7 @@ namespace OpenRCT2::Ui::Windows if (!Platform::IsFilenameValid(text)) { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); return; } @@ -1132,7 +1133,7 @@ namespace OpenRCT2::Ui::Windows const u8string path = Path::Combine(_directory, text); if (!Path::CreateDirectory(path)) { - ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, kStringIdNone, {}); return; } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1f27a32131f7..b594ba5aa042 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1129,7 +1129,7 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kMinimumMapSizePractical); ft.Add(kMaximumMapSizePractical); - TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); + TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, kStringIdNone, kStringIdNone, 4); } CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 111460ad0ecb..cb644ed12661 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -50,7 +50,7 @@ namespace OpenRCT2::Ui::Windows { StringId stringId; std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); - if (stringId == STR_NONE) + if (stringId == kStringIdNone) { return; } @@ -97,7 +97,7 @@ namespace OpenRCT2::Ui::Windows auto& im = GetInputManager(); auto* wm = GetWindowManager(); - if (_cursorHoldDuration < 25 || stringId == STR_NONE || im.IsModifierKeyPressed(ModifierKey::ctrl) + if (_cursorHoldDuration < 25 || stringId == kStringIdNone || im.IsModifierKeyPressed(ModifierKey::ctrl) || im.IsModifierKeyPressed(ModifierKey::shift) || wm->FindByClass(WindowClass::Error) != nullptr) { WindowCloseByClass(WindowClass::MapTooltip); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 7e6fa9aa161a..0f35508d4285 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -295,7 +295,7 @@ namespace OpenRCT2::Ui::Windows else { ft.Increment(4); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index baeeb8a986a8..36ecc9c40fe7 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -65,7 +65,7 @@ namespace OpenRCT2::Ui::Windows #define MAIN_MULTIPLAYER_WIDGETS \ MakeWidget({ 0, 0}, {340, 240}, WindowWidgetType::Frame, WindowColour::Primary ), /* panel / background */ \ - MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_NONE, STR_WINDOW_TITLE_TIP ), /* title bar */ \ + MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, kStringIdNone, STR_WINDOW_TITLE_TIP ), /* title bar */ \ MakeWidget({327, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP ), /* close x button */ \ MakeWidget({ 0, 43}, {340, 197}, WindowWidgetType::Resize, WindowColour::Secondary ), /* content panel */ \ MakeTab ({ 3, 17}, STR_SHOW_SERVER_INFO_TIP), /* tab */ \ diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index b38958ca7750..f5ee64ef20a2 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -27,7 +27,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_network_status_widgets[] = { MakeWidget({ 0, 0}, {400, 91}, WindowWidgetType::Frame, WindowColour::Primary ), // panel / background - MakeWidget({ 1, 1}, {397, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_NONE, STR_WINDOW_TITLE_TIP), // title bar + MakeWidget({ 1, 1}, {397, 14}, WindowWidgetType::Caption, WindowColour::Primary, kStringIdNone, STR_WINDOW_TITLE_TIP), // title bar MakeWidget({388, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP), // close x button }; // clang-format on diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 26beebf5ff38..765b015a720a 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -26,7 +26,7 @@ namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; static constexpr int32_t WH = 109; static constexpr int32_t WW = 350; @@ -50,11 +50,11 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_new_campaign_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget ({ 14, 24}, {126, 12}, WindowWidgetType::Label, WindowColour::Primary, STR_EMPTY ), // ride label - MakeWidget ({100, 24}, {242, 12}, WindowWidgetType::DropdownMenu, WindowColour::Primary, STR_EMPTY ), // ride dropdown + MakeWidget ({ 14, 24}, {126, 12}, WindowWidgetType::Label, WindowColour::Primary, kStringIdEmpty ), // ride label + MakeWidget ({100, 24}, {242, 12}, WindowWidgetType::DropdownMenu, WindowColour::Primary, kStringIdEmpty ), // ride dropdown MakeWidget ({330, 25}, { 11, 10}, WindowWidgetType::Button, WindowColour::Primary, STR_DROPDOWN_GLYPH ), // ride dropdown button MakeWidget ({ 14, 41}, {126, 14}, WindowWidgetType::Label, WindowColour::Primary, STR_LENGTH_OF_TIME ), // weeks label - MakeSpinnerWidgets({120, 41}, {100, 14}, WindowWidgetType::Spinner, WindowColour::Primary, STR_EMPTY ), // weeks (3 widgets) + MakeSpinnerWidgets({120, 41}, {100, 14}, WindowWidgetType::Spinner, WindowColour::Primary, kStringIdEmpty ), // weeks (3 widgets) MakeWidget ({ 14, 89}, {322, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN), // start button }; // clang-format on @@ -160,10 +160,10 @@ namespace OpenRCT2::Ui::Windows } } - if (RideList.size() > Dropdown::ItemsMaxSize) + if (RideList.size() > Dropdown::kItemsMaxSize) { std::sort(RideList.begin(), RideList.end(), RideValueCompare); - RideList.resize(Dropdown::ItemsMaxSize); + RideList.resize(Dropdown::kItemsMaxSize); } // Sort rides by name @@ -209,7 +209,7 @@ namespace OpenRCT2::Ui::Windows if (!ShopItems.empty()) { int32_t numItems = 0; - int32_t maxSize = std::min(Dropdown::ItemsMaxSize, static_cast(ShopItems.size())); + int32_t maxSize = std::min(Dropdown::kItemsMaxSize, static_cast(ShopItems.size())); for (int32_t i = 0; i < maxSize; i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; @@ -353,7 +353,7 @@ namespace OpenRCT2::Ui::Windows } // Set current number of weeks spinner (moved to paint due to required parameter) - widgets[WIDX_WEEKS_SPINNER].text = STR_NONE; + widgets[WIDX_WEEKS_SPINNER].text = kStringIdNone; // Enable / disable start button based on ride dropdown WidgetSetDisabled(*this, WIDX_START_BUTTON, false); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 6a596e16d942..585b1dccd5d0 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -42,7 +42,7 @@ using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::Ui::Windows { - static constexpr StringId WindowTitle = STR_NONE; + static constexpr StringId WindowTitle = kStringIdNone; static constexpr int32_t WindowHeight = 382; static constexpr int32_t WindowWidth = 601; static constexpr int32_t RideListItemsMax = 384; @@ -640,7 +640,7 @@ namespace OpenRCT2::Ui::Windows { auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); auto obj = objMgr.GetLoadedObject(rideSelection.EntryIndex); - return obj == nullptr ? ImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); + return obj == nullptr ? kImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); } void PopulateRideList() diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 19d55ac6b5b9..103ffedc869f 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -245,7 +245,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({155, 83}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_ARG_16_RESOLUTION_X_BY_Y ), MakeWidget ({288, 84}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DISPLAY_RESOLUTION_TIP ), MakeWidget ({ 10, 98}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_UI_SCALING_DESC, STR_WINDOW_SCALE_TIP ), // Scale - MakeSpinnerWidgets({155, 98}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_NONE, STR_WINDOW_SCALE_TIP ), // Scale spinner (3 widgets) + MakeSpinnerWidgets({155, 98}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, kStringIdNone, STR_WINDOW_SCALE_TIP ), // Scale spinner (3 widgets) MakeWidget ({ 10, 113}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_DRAWING_ENGINE, STR_DRAWING_ENGINE_TIP ), // Drawing engine MakeWidget ({155, 113}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Drawing engine MakeWidget ({288, 114}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DRAWING_ENGINE_TIP ), @@ -270,7 +270,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget({ 10, kFrameRenderingStart + 60}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_SHOW_GUEST_PURCHASES, STR_SHOW_GUEST_PURCHASES_TIP ), // Guest purchases MakeWidget({ 10, kFrameRenderingStart + 75}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TRANSPARENT_SCREENSHOT, STR_TRANSPARENT_SCREENSHOT_TIP), // Transparent screenshot MakeWidget({ 10, kFrameRenderingStart + 90}, {281, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_VIRTUAL_FLOOR_STYLE, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor - MakeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown + MakeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown MakeWidget({288, kFrameRenderingStart + 91}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown MakeWidget({ 5, kFrameEffectStart + 0}, {300, 94}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_EFFECTS_GROUP ), // Rendering group @@ -392,11 +392,11 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({165, 113}, {135, 13}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Autosave dropdown MakeWidget ({288, 114}, { 11, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_AUTOSAVE_FREQUENCY_TIP ), // Autosave dropdown button MakeWidget ({ 23, 130}, {135, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_AUTOSAVE_AMOUNT, STR_AUTOSAVE_AMOUNT_TIP ), - MakeSpinnerWidgets({165, 130}, {135, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_NONE, STR_AUTOSAVE_AMOUNT_TIP ), // Autosave amount spinner + MakeSpinnerWidgets({165, 130}, {135, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, kStringIdNone, STR_AUTOSAVE_AMOUNT_TIP ), // Autosave amount spinner MakeWidget ({ 23, 145}, {276, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_PATH_TO_RCT1, STR_PATH_TO_RCT1_TIP ), // RCT 1 path text - MakeWidget ({ 24, 160}, {266, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_NONE, STR_STRING_TOOLTIP ), // RCT 1 path button + MakeWidget ({ 24, 160}, {266, 14}, WindowWidgetType::Button, WindowColour::Secondary, kStringIdNone, STR_STRING_TOOLTIP ), // RCT 1 path button MakeWidget ({289, 160}, { 11, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CLOSE_X, STR_PATH_TO_RCT1_CLEAR_TIP ), // RCT 1 path clear button - MakeWidget ({150, 176}, {150, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_EDIT_ASSET_PACKS_BUTTON, STR_NONE ), // Asset packs + MakeWidget ({150, 176}, {150, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_EDIT_ASSET_PACKS_BUTTON, kStringIdNone ), // Asset packs }; static constexpr std::span window_options_page_widgets[] = { @@ -1110,7 +1110,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[i].Args = CurrencyDescriptors[i].stringId; } - gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::SeparatorString; + gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::kSeparatorString; gDropdownItems[numOrdinaryCurrencies + 1].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[numOrdinaryCurrencies + 1].Args = CurrencyDescriptors[EnumValue(CurrencyType::Custom)] @@ -1224,7 +1224,7 @@ namespace OpenRCT2::Ui::Windows if (LanguageOpen(fallbackLanguage)) { // It worked, so we can say it with error message in-game - ContextShowError(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); + ContextShowError(STR_LANGUAGE_LOAD_FAILED, kStringIdNone, {}); } // report error to console regardless LOG_ERROR("Failed to open language file."); @@ -1260,7 +1260,7 @@ namespace OpenRCT2::Ui::Windows // Distance: metric / imperial / si { - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; switch (Config::Get().general.MeasurementFormat) { case MeasurementFormat::Imperial: @@ -1927,21 +1927,21 @@ namespace OpenRCT2::Ui::Windows Config::Get().general.RCT1Path = std::move(rct1path); Config::Get().interface.ScenarioselectLastTab = 0; Config::Save(); - ContextShowError(STR_RESTART_REQUIRED, STR_NONE, {}); + ContextShowError(STR_RESTART_REQUIRED, kStringIdNone, {}); } else { - ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, kStringIdNone, {}); } } else { - ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, kStringIdNone, {}); } } else { - ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, kStringIdNone, {}); } } Invalidate(); @@ -2051,7 +2051,7 @@ namespace OpenRCT2::Ui::Windows if (Config::Get().general.RCT1Path.empty()) { // No tooltip if the path is empty - return { STR_NONE, {} }; + return { kStringIdNone, {} }; } auto ft = Formatter(); diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index ab45c1528926..733fb6181633 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -869,8 +869,8 @@ namespace OpenRCT2::Ui::Windows PrepareWindowTitleText(); // Show a tooltip if the park is pay per ride. - widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; - widgets[WIDX_PRICE].tooltip = STR_NONE; + widgets[WIDX_PRICE_LABEL].tooltip = kStringIdNone; + widgets[WIDX_PRICE].tooltip = kStringIdNone; if (!Park::EntranceFeeUnlocked()) { diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index e2fcb7cb6d86..cd34c9322f23 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -263,7 +263,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } bool PatrolAreaToolIsActive() diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index e80b0188b040..a87bcf58db3f 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -220,7 +220,7 @@ namespace OpenRCT2::Ui::Windows void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format) { - if (format == STR_NONE) + if (format == kStringIdNone) _progressFormat = STR_STRING_M_OF_N; else _progressFormat = format; diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index e15635a2102e..edf45cfd8bbb 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -441,7 +441,7 @@ namespace OpenRCT2::Ui::Windows if (gameState.ResearchLastItem.has_value()) { - StringId lastDevelopmentFormat = STR_EMPTY; + StringId lastDevelopmentFormat = kStringIdEmpty; auto ft = Formatter(); if (gameState.ResearchLastItem->type == Research::EntryType::Scenery) { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index aa5c262f8b33..6e97dd41b12d 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -280,7 +280,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({ 7, 50}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget ({297, 51}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), MakeWidget ({ 7, 137}, {302, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_OPTION_REVERSE_TRAINS, STR_OPTION_REVERSE_TRAINS_TIP ), - MakeWidget ({ 7, 154}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), + MakeWidget ({ 7, 154}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, kStringIdEmpty ), MakeSpinnerWidgets({ 7, 203}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_RIDE_VEHICLE_COUNT, STR_MAX_VEHICLES_TIP ), MakeSpinnerWidgets({164, 203}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_1_CAR_PER_TRAIN, STR_MAX_CARS_PER_TRAIN_TIP), }; @@ -310,7 +310,7 @@ namespace OpenRCT2::Ui::Windows // 0x009AE190 static constexpr Widget _maintenanceWidgets[] = { MAIN_RIDE_WIDGETS, - MakeWidget({107, 71}, {202, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), + MakeWidget({107, 71}, {202, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), MakeWidget({297, 72}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), MakeWidget({289, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_LOCATE_NEAREST_AVAILABLE_MECHANIC_TIP ), MakeWidget({265, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_CONSTRUCTION), STR_REFURBISH_RIDE_TIP ), @@ -332,9 +332,9 @@ namespace OpenRCT2::Ui::Windows MakeWidget({301, 50}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), MakeWidget({289, 68}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PAINTBRUSH), STR_PAINT_INDIVIDUAL_AREA_TIP ), MakeWidget({245, 101}, { 68, 47}, WindowWidgetType::Spinner, WindowColour::Secondary ), - MakeWidget({103, 103}, {139, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({103, 103}, {139, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({230, 104}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_STYLE_OF_ENTRANCE_EXIT_STATION_TIP), - MakeWidget({ 3, 157}, { 68, 47}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({ 3, 157}, { 68, 47}, WindowWidgetType::Scroll, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({ 74, 157}, {239, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_ARG_6_STRINGID ), MakeWidget({301, 158}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_COLOUR_SCHEME_TIP ), MakeWidget({ 74, 173}, {239, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), @@ -350,7 +350,7 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget _musicWidgets[] = { MAIN_RIDE_WIDGETS, MakeWidget({ 7, 47}, {302, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_PLAY_MUSIC, STR_SELECT_MUSIC_TIP ), - MakeWidget({ 7, 62}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({ 7, 62}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({297, 63}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_MUSIC_STYLE_TIP), MakeWidget({154, 90}, {114, 114}, WindowWidgetType::FlatBtn, WindowColour::Secondary ), MakeWidget({ 7, 90}, {500, 450}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_BOTH ), @@ -2070,7 +2070,7 @@ namespace OpenRCT2::Ui::Windows PopulateVehicleTypeDropdown(*ride); - size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::ItemsMaxSize); + size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::kItemsMaxSize); for (size_t i = 0; i < numItems; i++) { @@ -2452,7 +2452,7 @@ namespace OpenRCT2::Ui::Windows StringId GetStatusOverallView(Formatter& ft) const { - auto stringId = STR_NONE; + auto stringId = kStringIdNone; auto ride = GetRide(rideId); if (ride != nullptr) { @@ -2470,11 +2470,11 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return STR_EMPTY; + return kStringIdEmpty; auto vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); if (vehicle == nullptr) - return STR_EMPTY; + return kStringIdEmpty; auto& rtd = ride->GetRideTypeDescriptor(); if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed) @@ -2494,7 +2494,7 @@ namespace OpenRCT2::Ui::Windows } if (rtd.specialType == RtdSpecialType::miniGolf) - return STR_EMPTY; + return kStringIdEmpty; auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::singleSession) @@ -2520,16 +2520,16 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return STR_NONE; + return kStringIdNone; const auto stationIndex = GetStationIndexFromViewSelection(); if (!stationIndex) { - return STR_NONE; + return kStringIdNone; } const auto& station = ride->GetStation(*stationIndex); - StringId stringId = STR_EMPTY; + StringId stringId = kStringIdEmpty; // Entrance / exit if (ride->status == RideStatus::Closed) { @@ -2544,7 +2544,7 @@ namespace OpenRCT2::Ui::Windows stringId = STR_EXIT_ONLY; } // Queue length - if (stringId == STR_EMPTY) + if (stringId == kStringIdEmpty) { stringId = STR_QUEUE_EMPTY; uint16_t queueLength = ride->GetStation(*stationIndex).QueueLength; @@ -2724,7 +2724,7 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return { STR_NONE, {} }; + return { kStringIdNone, {} }; switch (widgetIndex) { @@ -2751,7 +2751,7 @@ namespace OpenRCT2::Ui::Windows { auto rideEntry = ride->GetRideEntry(); if (rideEntry == nullptr) - return { STR_NONE, {} }; + return { kStringIdNone, {} }; auto ft = Formatter(); ft.Increment(16); @@ -3012,7 +3012,7 @@ namespace OpenRCT2::Ui::Windows VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleColourIndex); ImageIndex imageIndex = carEntry.SpriteByYaw( - OpenRCT2::Entity::Yaw::BaseRotation / 2, SpriteGroupType::SlopeFlat); + OpenRCT2::Entity::Yaw::kBaseRotation / 2, SpriteGroupType::SlopeFlat); if (isReversed) { auto baseRotation = carEntry.NumRotationSprites(SpriteGroupType::SlopeFlat); @@ -3730,7 +3730,7 @@ namespace OpenRCT2::Ui::Windows mechanic = RideFindClosestMechanic(*ride, 1); if (mechanic == nullptr) - ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, kStringIdNone, {}); else { auto intent = Intent(WindowClass::Peep); @@ -3803,7 +3803,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_FORCE_BREAKDOWN: numItems = 1; - for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) break; @@ -3827,7 +3827,7 @@ namespace OpenRCT2::Ui::Windows } if (numItems == 1) { - ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); + ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, kStringIdNone, {}); } else { @@ -3943,7 +3943,7 @@ namespace OpenRCT2::Ui::Windows else { int32_t j; - for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) break; @@ -4115,11 +4115,11 @@ namespace OpenRCT2::Ui::Windows stringId = STR_MECHANIC_IS_FIXING_THE_RIDE; break; default: - stringId = STR_EMPTY; + stringId = kStringIdEmpty; break; } - if (stringId != STR_EMPTY) + if (stringId != kStringIdEmpty) { if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE) { @@ -4393,7 +4393,7 @@ namespace OpenRCT2::Ui::Windows stringId = ride->vehicleColourSettings == VehicleColourSettings::perTrain ? STR_RIDE_COLOUR_TRAIN_OPTION : STR_RIDE_COLOUR_VEHICLE_OPTION; auto dropdownIndex = 0; - for (auto i = 0; i < std::min(numItems, Dropdown::ItemsMaxSize); i++) + for (auto i = 0; i < std::min(numItems, Dropdown::kItemsMaxSize); i++) { if (ride->vehicleColourSettings == VehicleColourSettings::perCar) { @@ -4676,7 +4676,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu; widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Button; - auto stringId = STR_NONE; + auto stringId = kStringIdNone; auto stationObj = ride->GetStationObject(); if (stationObj != nullptr) { @@ -4899,7 +4899,7 @@ namespace OpenRCT2::Ui::Windows GfxClear(clippedDpi, PALETTE_INDEX_12); auto stationObj = ride->GetStationObject(); - if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined) + if (stationObj != nullptr && stationObj->BaseImageId != kImageIndexUndefined) { auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional); @@ -5185,7 +5185,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MUSIC_DROPDOWN].left = width - 19; // Set selected music - StringId musicName = STR_NONE; + StringId musicName = kStringIdNone; auto musicObj = ride->GetMusicObject(); if (musicObj != nullptr) { @@ -5399,7 +5399,7 @@ namespace OpenRCT2::Ui::Windows } if (errMessage.HasMessage()) { - ContextShowError(errMessage.Message, STR_EMPTY, {}); + ContextShowError(errMessage.Message, kStringIdEmpty, {}); } } @@ -5990,7 +5990,7 @@ namespace OpenRCT2::Ui::Windows } else { - return { STR_NONE, {} }; + return { kStringIdNone, {} }; } return { fallback, {} }; } @@ -6525,8 +6525,8 @@ namespace OpenRCT2::Ui::Windows pressed_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); disabled_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE); - widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_NONE; - widgets[WIDX_PRIMARY_PRICE].tooltip = STR_NONE; + widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = kStringIdNone; + widgets[WIDX_PRIMARY_PRICE].tooltip = kStringIdNone; // If ride prices are locked, do not allow setting the price, unless we're dealing with a shop or toilet. const auto& rtd = ride->GetRideTypeDescriptor(); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 37a5c44a878f..90c83cde77ad 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2248,7 +2248,7 @@ namespace OpenRCT2::Ui::Windows _currentTrackPrice = kMoney64Undefined; _trackPlaceCost = kMoney64Undefined; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; RideConstructionInvalidateCurrentTrack(); if (WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, &properties)) @@ -2284,7 +2284,7 @@ namespace OpenRCT2::Ui::Windows else { _trackPlaceCost = res.Cost; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; } if (res.Error != GameActions::Status::Ok) @@ -3624,7 +3624,7 @@ namespace OpenRCT2::Ui::Windows if (mazeSetTrackResult.Error == GameActions::Status::Ok) { _trackPlaceCost = mazeSetTrackResult.Cost; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; } else { diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index f397053326ba..0dfdfbb79e9f 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -32,7 +32,7 @@ namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; static constexpr int32_t WH = 240; static constexpr int32_t WW = 340; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 3af88206462f..d217caba43e2 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -42,8 +42,8 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget _savePromptWidgets[] = { - WINDOW_SHIM_WHITE(STR_NONE, WW_SAVE, WH_SAVE), - MakeWidget({ 2, 19}, {256, 12}, WindowWidgetType::LabelCentred, WindowColour::Primary, STR_EMPTY ), // question/label + WINDOW_SHIM_WHITE(kStringIdNone, WW_SAVE, WH_SAVE), + MakeWidget({ 2, 19}, {256, 12}, WindowWidgetType::LabelCentred, WindowColour::Primary, kStringIdEmpty ), // question/label MakeWidget({ 8, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_SAVE ), // save MakeWidget({ 91, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_DONT_SAVE), // don't save MakeWidget({174, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL ), // cancel diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 7341aafffa7c..0f97bc6b3508 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -548,7 +548,7 @@ namespace OpenRCT2::Ui::Windows continue; // Category heading - StringId headingStringId = STR_NONE; + StringId headingStringId = kStringIdNone; if (Config::Get().general.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { if (selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->Category) @@ -582,7 +582,7 @@ namespace OpenRCT2::Ui::Windows } } - if (headingStringId != STR_NONE) + if (headingStringId != kStringIdNone) { ScenarioListItem headerItem; headerItem.type = ListItemType::Heading; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 074018defdf2..b445c2be32f0 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -66,7 +66,7 @@ using namespace OpenRCT2::Numerics; namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 195; constexpr int32_t SCENERY_BUTTON_WIDTH = 66; @@ -627,7 +627,7 @@ namespace OpenRCT2::Ui::Windows } } } - return { STR_NONE, Formatter() }; + return { kStringIdNone, Formatter() }; } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 5775a101276d..749cea1a9a77 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::Ui::Windows break; } WindowTextInputOpen( - this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, maxLength); + this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, maxLength); } void OnMouseUp(WidgetIndex widgetIndex) override diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index e8f630796641..e74135dce22e 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -156,7 +156,7 @@ namespace OpenRCT2::Ui::Windows ServerListFetchServersBegin(); break; case WIDX_ADD_SERVER: - TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); + TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, kStringIdNone, 0, 128); break; case WIDX_START_SERVER: ContextOpenWindow(WindowClass::ServerStart); @@ -265,7 +265,7 @@ namespace OpenRCT2::Ui::Windows selected_list_item = itemIndex; _showNetworkVersionTooltip = showNetworkVersionTooltip; - listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : kStringIdNone; WindowTooltipClose(); Invalidate(); @@ -465,7 +465,7 @@ namespace OpenRCT2::Ui::Windows { } - auto status = STR_NONE; + auto status = kStringIdNone; try { auto entries = wanF.get(); @@ -499,7 +499,7 @@ namespace OpenRCT2::Ui::Windows _serverList.WriteFavourites(); // Update favourites in case favourited server info changes _numPlayersOnline = _serverList.GetTotalPlayerCount(); _statusText = STR_X_PLAYERS_ONLINE; - if (statusText != STR_NONE) + if (statusText != kStringIdNone) { _statusText = statusText; } @@ -584,7 +584,7 @@ namespace OpenRCT2::Ui::Windows if (!NetworkBeginClient(address, port)) { - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, kStringIdNone, {}); } } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index ccf85a74754b..75f54a5bbbfe 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -163,7 +163,7 @@ namespace OpenRCT2::Ui::Windows struct ShortcutStringPair { std::string ShortcutId; - ::StringId StringId = STR_NONE; + ::StringId StringId = kStringIdNone; std::string CustomString; std::string Binding; }; @@ -454,7 +454,7 @@ namespace OpenRCT2::Ui::Windows int32_t x = 3; for (size_t i = 0; i < _tabs.size(); i++) { - auto tab = MakeTab({ x, 17 }, STR_NONE); + auto tab = MakeTab({ x, 17 }, kStringIdNone); widgets.push_back(tab); x += 31; } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index b7a8290f91c4..40ee43cebfce 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -684,7 +684,7 @@ namespace OpenRCT2::Ui::Windows gPickupPeepImage = ImageId(); - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + auto info = GetMapCoordinatesFromPos(screenCoords, kViewportInteractionItemAll); if (info.interactionType == ViewportInteractionItem::None) return; @@ -859,7 +859,7 @@ namespace OpenRCT2::Ui::Windows } else { - widgets[WIDX_COSTUME_BOX].text = STR_EMPTY; + widgets[WIDX_COSTUME_BOX].text = kStringIdEmpty; widgets[WIDX_COSTUME_BOX].flags &= ~WIDGET_FLAGS::TEXT_IS_STRING; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index b66b2d280c35..810cb5c6d706 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -87,8 +87,8 @@ namespace OpenRCT2::Ui::Windows MakeTab ({ 65, 17}, STR_STAFF_SECURITY_TAB_TIP ), // security guards tab MakeTab ({ 96, 17}, STR_STAFF_ENTERTAINERS_TAB_TIP ), // entertainers tab MakeWidget({ 3, 72}, {WW - 6, 195}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // staff list - MakeWidget({130, 58}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, STR_NONE, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker - MakeWidget({165, 17}, { 145, 13}, WindowWidgetType::Button, WindowColour::Primary , STR_NONE, STR_HIRE_STAFF_TIP ), // hire button + MakeWidget({130, 58}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, kStringIdNone, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker + MakeWidget({165, 17}, { 145, 13}, WindowWidgetType::Button, WindowColour::Primary , kStringIdNone, STR_HIRE_STAFF_TIP ), // hire button MakeWidget({243, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_QUICK_FIRE_STAFF ), // quick fire staff MakeWidget({267, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PATROL_BTN), STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool MakeWidget({291, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_MAP), STR_SHOW_STAFF_ON_MAP_TIP), // show staff on map button @@ -483,7 +483,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); - ContextShowError(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); + ContextShowError(STR_NO_THING_IN_PARK_YET, kStringIdNone, ft); } } } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 931d5ad063ac..0a08a593b976 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -35,7 +35,7 @@ namespace OpenRCT2::Ui::Windows }; static constexpr Widget _textInputWidgets[] = { - WINDOW_SHIM(STR_NONE, WW, WH), + WINDOW_SHIM(kStringIdNone, WW, WH), MakeWidget({ 170, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL), MakeWidget({ 10, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_OK), }; @@ -46,10 +46,10 @@ namespace OpenRCT2::Ui::Windows WidgetIdentifier _parentWidget{}; std::string _title; - StringId _titleStringId = STR_NONE; + StringId _titleStringId = kStringIdNone; std::string _description; - StringId _descriptionStringId = STR_NONE; + StringId _descriptionStringId = kStringIdNone; Formatter _descriptionArgs; std::function _callback; @@ -101,9 +101,9 @@ namespace OpenRCT2::Ui::Windows void SetTitle(std::string_view title, std::string_view description) { - _titleStringId = STR_NONE; + _titleStringId = kStringIdNone; _title = title; - _descriptionStringId = STR_NONE; + _descriptionStringId = kStringIdNone; _description = description; } @@ -182,7 +182,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_BACKGROUND].bottom = newHeight - 1; // Set window title argument - if (_titleStringId == STR_NONE) + if (_titleStringId == kStringIdNone) { auto ft = Formatter::Common(); ft.Add(_title.c_str()); @@ -203,7 +203,7 @@ namespace OpenRCT2::Ui::Windows int32_t no_lines = 0; - if (_descriptionStringId == STR_NONE) + if (_descriptionStringId == kStringIdNone) { auto ft = Formatter(); ft.Add(_description.c_str()); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 79e6094e5ff9..3b3eb85b1bba 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -529,7 +529,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_RIDE_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -541,7 +541,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_PARK_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -553,7 +553,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_SCENARIO_FONT: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -566,7 +566,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -597,7 +597,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_DELETE_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -607,7 +607,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RENAME_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -673,12 +673,12 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, kStringIdNone, {}); } } else { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); } break; } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 02670ae7e85d..a686f45ca9ef 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -301,8 +301,8 @@ namespace OpenRCT2::Ui::Windows MakeWidget(GhostFlagColumnXY, GhostFlagColumnSize, WindowWidgetType::TableHeader, WindowColour::Secondary, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, STR_TILE_INSPECTOR_FLAG_GHOST), /* Ghost flag */ \ MakeWidget(LastFlagColumnXY, LastFlagColumnSize, WindowWidgetType::TableHeader, WindowColour::Secondary, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, STR_TILE_INSPECTOR_FLAG_LAST), /* Last of tile flag */ \ /* Group boxes */ \ - MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_NONE, STR_NONE ), /* Details group box */ \ - MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, STR_NONE ) /* Properties group box */ + MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, kStringIdNone, kStringIdNone ), /* Details group box */ \ + MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, kStringIdNone ) /* Properties group box */ static constexpr Widget DefaultWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, @@ -1093,7 +1093,7 @@ static uint64_t PageDisabledWidgets[] = { { // Details // Terrain texture name - StringId terrainNameId = STR_EMPTY; + StringId terrainNameId = kStringIdEmpty; auto surfaceStyle = tileElement->AsSurface()->GetSurfaceObject(); if (surfaceStyle != nullptr) terrainNameId = surfaceStyle->NameStringId; @@ -1102,7 +1102,7 @@ static uint64_t PageDisabledWidgets[] = { DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); // Edge texture name - StringId terrainEdgeNameId = STR_EMPTY; + StringId terrainEdgeNameId = kStringIdEmpty; auto edgeStyle = tileElement->AsSurface()->GetEdgeObject(); if (edgeStyle != nullptr) terrainEdgeNameId = edgeStyle->NameStringId; diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 6c58d6d3782c..433fec9fa83f 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -194,7 +194,7 @@ namespace OpenRCT2::Ui::Windows if (!hasCustomItems) { hasCustomItems = true; - gDropdownItems[i++].Format = STR_EMPTY; + gDropdownItems[i++].Format = kStringIdEmpty; } gDropdownItems[i].Format = STR_STRING; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 9382a3f9eaca..bd67b7fa7cf2 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -195,7 +195,7 @@ namespace OpenRCT2::Ui::Windows gTooltipWidget.window_number = widgetWindow->number; gTooltipWidget.widget_index = widgetIndex; result = widgetWindow->OnTooltip(widgetIndex, stringId); - if (result.str == STR_NONE) + if (result.str == kStringIdNone) return; } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index b1cf49634508..cbf749c37fa1 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -373,7 +373,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CHAT_UNAVAILABLE, STR_NONE, {}); + ContextShowError(STR_CHAT_UNAVAILABLE, kStringIdNone, {}); } break; } @@ -1179,7 +1179,7 @@ namespace OpenRCT2::Ui::Windows const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; if (!customMenuItems.empty()) { - gDropdownItems[i++].Format = STR_EMPTY; + gDropdownItems[i++].Format = kStringIdEmpty; for (const auto& item : customMenuItems) { if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) @@ -1253,7 +1253,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[3].Format = STR_TOGGLE_OPTION; if (Config::Get().general.DebuggingTools) { - gDropdownItems[4].Format = STR_EMPTY; + gDropdownItems[4].Format = kStringIdEmpty; gDropdownItems[5].Format = STR_TOGGLE_OPTION; gDropdownItems[5].Args = STR_SPEED_HYPER; num_items = 6; @@ -1340,7 +1340,7 @@ namespace OpenRCT2::Ui::Windows { gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1348,7 +1348,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) gDropdownItems[numItems++].Format = STR_QUIT_ROLLERCOASTER_DESIGNER; @@ -1360,12 +1360,12 @@ namespace OpenRCT2::Ui::Windows else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { gDropdownItems[numItems++].Format = STR_LOAD_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SAVE_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1373,7 +1373,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_QUIT_SCENARIO_EDITOR; gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; } @@ -1381,13 +1381,13 @@ namespace OpenRCT2::Ui::Windows { gDropdownItems[numItems++].Format = STR_NEW_GAME; gDropdownItems[numItems++].Format = STR_LOAD_GAME; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SAVE_GAME; gDropdownItems[numItems++].Format = STR_SAVE_GAME_AS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1395,7 +1395,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_QUIT_TO_MENU; gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 402c8bbee68c..3bd1a85b481c 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -159,7 +159,7 @@ namespace OpenRCT2::Ui::Windows } else if (text.empty()) { - ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, kStringIdNone, {}); return; } else if (!Platform::IsFilenameValid(text)) diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 4841a6a05b59..29f1222217bc 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -154,7 +154,7 @@ namespace OpenRCT2::Ui::Windows if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED && (_loadedTrackDesign->gameStateData.hasFlag(TrackDesignGameStateFlag::VehicleUnavailable))) { - ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); + ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, kStringIdNone, {}); } auto intent = Intent(WindowClass::TrackDesignPlace); @@ -377,7 +377,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; const auto* entry = GetRideEntryByIndex(_window_track_list_item.EntryIndex); if (entry != nullptr) diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 6656dcb31f5d..b1df9d24d062 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -75,12 +75,12 @@ namespace OpenRCT2::Ui::Windows MakeWidget({152, 17}, HIDE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_GUESTS), STR_SEE_THROUGH_GUESTS), MakeWidget({177, 17}, HIDE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SEE_THROUGH_STAFF), - MakeWidget({ 2, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_VEGETATION), - MakeWidget({ 27, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_SCENERY), - MakeWidget({ 52, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_PATHS), - MakeWidget({ 77, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_RIDES), - MakeWidget({102, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_VEHICLES), - MakeWidget({127, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_SUPPORTS), + MakeWidget({ 2, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_VEGETATION), + MakeWidget({ 27, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_SCENERY), + MakeWidget({ 52, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_PATHS), + MakeWidget({ 77, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_RIDES), + MakeWidget({102, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_VEHICLES), + MakeWidget({127, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_SUPPORTS), }; // clang-format on diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 2758f22886c2..06f9d467dc5d 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 11, 19}, { 159, 11}, WindowWidgetType::Checkbox, WindowColour::Primary, STR_VIEW_CLIPPING_HEIGHT_ENABLE, STR_VIEW_CLIPPING_HEIGHT_ENABLE_TIP ), // clip enable/disable check box MakeWidget ({ 5, 36}, {WW - 10, 48}, WindowWidgetType::Groupbox, WindowColour::Primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING ), - MakeSpinnerWidgets({ 90, 51}, { 79, 12}, WindowWidgetType::Spinner, WindowColour::Primary, STR_NONE, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE), // clip height (3 widgets) + MakeSpinnerWidgets({ 90, 51}, { 79, 12}, WindowWidgetType::Spinner, WindowColour::Primary, kStringIdNone, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE), // clip height (3 widgets) MakeWidget ({ 11, 66}, { 158, 13}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_HORIZONTAL, STR_VIEW_CLIPPING_HEIGHT_SCROLL_TIP ), // clip height scrollbar MakeWidget ({ 5, 90}, {WW - 10, 60}, WindowWidgetType::Groupbox, WindowColour::Primary, STR_VIEW_CLIPPING_HORIZONTAL_CLIPPING ), MakeWidget ({ 11, 105}, { 158, 17}, WindowWidgetType::Button, WindowColour::Primary, STR_VIEW_CLIPPING_SELECT_AREA ), // selector diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 368e8fb70186..42fe0f6eb655 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -151,7 +151,7 @@ namespace OpenRCT2::Ui::Windows if (mainWindow != nullptr) { auto info = GetMapCoordinatesFromPos( - { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); + { windowPos.x + (width / 2), windowPos.y + (height / 2) }, kViewportInteractionItemAll); WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); } break; diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 8d7e4c635a5e..74eb06e9145c 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -42,7 +42,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget _waterWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), STR_NONE), // preview box + MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box MakeRemapWidget({17, 18}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_WATER_TIP), // decrement size MakeRemapWidget({43, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_WATER_TIP), // increment size }; @@ -419,7 +419,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } }; diff --git a/src/openrct2-ui/windows/Windows.h b/src/openrct2-ui/windows/Windows.h index 548abfc9b5af..c29aa1828527 100644 --- a/src/openrct2-ui/windows/Windows.h +++ b/src/openrct2-ui/windows/Windows.h @@ -199,7 +199,7 @@ namespace OpenRCT2::Ui::Windows // ProgressWindow WindowBase* ProgressWindowOpen(const std::string& text, CloseCallback onClose = nullptr); - void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE); + void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone); void ProgressWindowClose(); // PatrolArea diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d9df787f5226..290f18239a46 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -411,14 +411,14 @@ namespace OpenRCT2 CrashInit(); - if (String::equals(Config::Get().general.LastRunVersion, OPENRCT2_VERSION)) + if (String::equals(Config::Get().general.LastRunVersion, kOpenRCT2Version)) { gOpenRCT2ShowChangelog = false; } else { gOpenRCT2ShowChangelog = true; - Config::Get().general.LastRunVersion = OPENRCT2_VERSION; + Config::Get().general.LastRunVersion = kOpenRCT2Version; Config::Save(); } @@ -665,7 +665,7 @@ namespace OpenRCT2 ContextOpenIntent(&intent); } - void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE) override + void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone) override { if (_forcedUpdateTimer.GetElapsedTime() < kForcedUpdateInterval) return; @@ -741,7 +741,7 @@ namespace OpenRCT2 SetActiveScene(GetTitleScene()); } auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, STR_NONE, {}); + windowManager->ShowError(STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, kStringIdNone, {}); } return false; } @@ -867,14 +867,14 @@ namespace OpenRCT2 auto windowManager = _uiContext->GetWindowManager(); auto ft = Formatter(); ft.Add(result.TargetVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_WARNING_PARK_VERSION_TITLE, STR_WARNING_PARK_VERSION_MESSAGE, ft); } else if (HasObjectsThatUseFallbackImages()) { Console::Error::WriteLine("Park has objects which require RCT1 linked. Fallback images will be used."); auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_PARK_USES_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter()); + windowManager->ShowError(STR_PARK_USES_FALLBACK_IMAGES_WARNING, kStringIdEmpty, Formatter()); } CloseProgress(); @@ -909,7 +909,7 @@ namespace OpenRCT2 SetActiveScene(GetTitleScene()); } auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES, STR_NONE, {}); + windowManager->ShowError(STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES, kStringIdNone, {}); } catch (const UnsupportedVersionException& e) { @@ -921,7 +921,7 @@ namespace OpenRCT2 } auto windowManager = _uiContext->GetWindowManager(); Formatter ft; - /*if (e.TargetVersion < PARK_FILE_MIN_SUPPORTED_VERSION) + /*if (e.TargetVersion < kParkFileMinSupportedVersion) { ft.Add(e.TargetVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_OLD_MESSAGE, ft); @@ -931,14 +931,14 @@ namespace OpenRCT2 if (e.MinVersion == e.TargetVersion) { ft.Add(e.TargetVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE_2, ft); } else { ft.Add(e.TargetVersion); ft.Add(e.MinVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE, ft); } } diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 1a8649e6d855..737b6415e8f1 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -160,7 +160,7 @@ namespace OpenRCT2 virtual void DisposeDrawingEngine() = 0; virtual void OpenProgress(StringId captionStringId) = 0; - virtual void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE) = 0; + virtual void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone) = 0; virtual void CloseProgress() = 0; virtual bool LoadParkFromFile(const u8string& path, bool loadTitleScreenOnFail = false, bool asScenario = false) = 0; diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 9639c82e576e..67089f25a50f 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -421,7 +421,7 @@ namespace OpenRCT2::Editor const bool isTrackDesignerManager = gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER); if (isTrackDesignerManager) { - return { ObjectType::None, STR_NONE }; + return { ObjectType::None, kStringIdNone }; } if (!EditorCheckObjectGroupAtLeastOneSurfaceSelected(false)) @@ -465,7 +465,7 @@ namespace OpenRCT2::Editor } } - return { ObjectType::None, STR_NONE }; + return { ObjectType::None, kStringIdNone }; } /** @@ -509,7 +509,7 @@ namespace OpenRCT2::Editor return { false, STR_PEEP_SPAWNS_NOT_SET }; } - return { true, STR_NONE }; + return { true, kStringIdNone }; } uint8_t GetSelectedObjectFlags(ObjectType objectType, size_t index) diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index a435f21a8105..ab0dfcedc75b 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -82,7 +82,7 @@ static bool TryClassifyAsPark(OpenRCT2::IStream* stream, ClassifiedFileInfo* res try { auto magic = stream->ReadValue(); - if (magic == OpenRCT2::PARK_FILE_MAGIC) + if (magic == OpenRCT2::kParkFileMagic) { result->Type = FILE_TYPE::PARK; result->Version = 0; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 9ca7527c5dd7..4c6d5032f55a 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -437,7 +437,7 @@ void GameNotifyMapChanged() */ void ResetAllSpriteQuadrantPlacements() { - for (EntityId::UnderlyingType i = 0; i < MAX_ENTITIES; i++) + for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr != nullptr && spr->Type != EntityType::Null) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 8e0f694a21af..708d3dad5ca9 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -90,7 +90,7 @@ namespace OpenRCT2 std::string ScenarioFileName; std::vector Banners; - Entity_t Entities[MAX_ENTITIES]{}; + Entity_t Entities[kMaxEntities]{}; // Ride storage for all the rides in the park, rides with RideId::Null are considered free. std::array Rides{}; size_t RidesEndOfUsedRange{}; diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 3dc5039e3412..3f5bfec3451e 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -23,8 +23,8 @@ #include "entity/Staff.h" #include "ride/Vehicle.h" -static constexpr size_t MaximumGameStateSnapshots = 32; -static constexpr uint32_t InvalidTick = 0xFFFFFFFF; +static constexpr size_t kMaximumGameStateSnapshots = 32; +static constexpr uint32_t kInvalidTick = 0xFFFFFFFF; #pragma pack(push, 1) union EntitySnapshot @@ -48,7 +48,7 @@ struct GameStateSnapshot_t return *this; } - uint32_t tick = InvalidTick; + uint32_t tick = kInvalidTick; uint32_t srand0 = 0; OpenRCT2::MemoryStream storedSprites; @@ -187,7 +187,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots virtual void Capture(GameStateSnapshot_t& snapshot) override final { snapshot.SerialiseSprites( - [](const EntityId index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); + [](const EntityId index) { return reinterpret_cast(GetEntity(index)); }, kMaxEntities, true); // LOG_INFO("Snapshot size: %u bytes", static_cast(snapshot.storedSprites.GetLength())); } @@ -213,7 +213,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const { std::vector spriteList; - spriteList.resize(MAX_ENTITIES); + spriteList.resize(kMaxEntities); for (auto& sprite : spriteList) { @@ -222,7 +222,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots } snapshot.SerialiseSprites( - [&spriteList](const EntityId index) { return &spriteList[index.ToUnderlying()]; }, MAX_ENTITIES, false); + [&spriteList](const EntityId index) { return &spriteList[index.ToUnderlying()]; }, kMaxEntities, false); return spriteList; } @@ -789,7 +789,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots } private: - CircularBuffer, MaximumGameStateSnapshots> _snapshots; + CircularBuffer, kMaximumGameStateSnapshots> _snapshots; }; std::unique_ptr CreateGameStateSnapshots() diff --git a/src/openrct2/Limits.h b/src/openrct2/Limits.h index b2fcefa742ec..907367531bba 100644 --- a/src/openrct2/Limits.h +++ b/src/openrct2/Limits.h @@ -20,8 +20,8 @@ namespace OpenRCT2::Limits constexpr uint16_t kMaxInversions = RCT12::Limits::kMaxInversions; constexpr uint16_t kMaxTrainsPerRide = 255; constexpr uint16_t kMaxCarsPerTrain = 255; - constexpr const uint16_t kMaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide * - // kMaxCarsPerTrain + constexpr uint16_t kMaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide * + // kMaxCarsPerTrain // kMaxVehicleColours should be set to kMaxTrainsPerRide or kMaxCarsPerTrain, whichever is higher. // Sadly, using std::max() will cause compilation failures when using kMaxVehicleColours as an array size, // hence the usage of static asserts. diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 1ff63ab9a138..16ef59f68fb0 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -20,7 +20,7 @@ using namespace OpenRCT2; -static constexpr const char* DirectoryNamesRCT2[] = { +static constexpr const char* kDirectoryNamesRCT2[] = { "Data", // DATA "Landscapes", // LANDSCAPE nullptr, // LANGUAGE @@ -38,7 +38,7 @@ static constexpr const char* DirectoryNamesRCT2[] = { "Tracks", // TRACK }; -static constexpr u8string_view DirectoryNamesOpenRCT2[] = { +static constexpr u8string_view kDirectoryNamesOpenRCT2[] = { u8"data", // DATA u8"landscape", // LANDSCAPE u8"language", // LANGUAGE @@ -62,7 +62,7 @@ static constexpr u8string_view DirectoryNamesOpenRCT2[] = { u8"scenario_patches", // SCENARIO_PATCHES }; -static constexpr u8string_view FileNames[] = { +static constexpr u8string_view kFileNames[] = { u8"config.ini", // CONFIG u8"hotkeys.dat", // CONFIG_SHORTCUTS_LEGACY u8"shortcuts.json", // CONFIG_SHORTCUTS @@ -83,13 +83,13 @@ static constexpr u8string_view FileNames[] = { class PlatformEnvironment final : public IPlatformEnvironment { private: - u8string _basePath[DIRBASE_COUNT]; + u8string _basePath[kDirBaseCount]; bool _usingRCTClassic{}; public: explicit PlatformEnvironment(DIRBASE_VALUES basePaths) { - for (size_t i = 0; i < DIRBASE_COUNT; i++) + for (size_t i = 0; i < kDirBaseCount; i++) { _basePath[i] = basePaths[i]; } @@ -108,15 +108,15 @@ class PlatformEnvironment final : public IPlatformEnvironment { default: case DIRBASE::RCT1: - directoryName = DirectoryNamesRCT2[EnumValue(did)]; + directoryName = kDirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::RCT2: - directoryName = _usingRCTClassic ? "Assets" : DirectoryNamesRCT2[EnumValue(did)]; + directoryName = _usingRCTClassic ? "Assets" : kDirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::OPENRCT2: case DIRBASE::USER: case DIRBASE::CONFIG: - directoryName = DirectoryNamesOpenRCT2[EnumValue(did)]; + directoryName = kDirectoryNamesOpenRCT2[EnumValue(did)]; break; } @@ -127,7 +127,7 @@ class PlatformEnvironment final : public IPlatformEnvironment { auto dirbase = GetDefaultBaseDirectory(pathid); auto basePath = GetDirectoryPath(dirbase); - auto fileName = FileNames[EnumValue(pathid)]; + auto fileName = kFileNames[EnumValue(pathid)]; return Path::Combine(basePath, fileName); } @@ -225,7 +225,7 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() auto subDirectory = GetOpenRCT2DirectoryName(); // Set default paths - std::string basePaths[DIRBASE_COUNT]; + std::string basePaths[kDirBaseCount]; basePaths[EnumValue(DIRBASE::OPENRCT2)] = Platform::GetInstallPath(); basePaths[EnumValue(DIRBASE::USER)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_DATA), subDirectory); basePaths[EnumValue(DIRBASE::CONFIG)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CONFIG), subDirectory); diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index 120970ac6778..cffd7c33df67 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -26,8 +26,8 @@ namespace OpenRCT2 CACHE, // Base directory for OpenRCT2 cache files. DOCUMENTATION, // Base directory for OpenRCT2 doc files. }; - constexpr size_t DIRBASE_COUNT = 7; - using DIRBASE_VALUES = u8string[DIRBASE_COUNT]; + constexpr size_t kDirBaseCount = 7; + using DIRBASE_VALUES = u8string[kDirBaseCount]; enum class DIRID { diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index 49874fd29149..1f528fed4c19 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -26,7 +26,7 @@ const char gVersionInfoTag[] = #ifdef OPENRCT2_VERSION_TAG OPENRCT2_VERSION_TAG #else - "v" OPENRCT2_VERSION + "v" kOpenRCT2Version #endif ; @@ -34,7 +34,7 @@ const char gVersionInfoFull[] = OPENRCT2_NAME ", " #ifdef OPENRCT2_VERSION_TAG OPENRCT2_VERSION_TAG #else - "v" OPENRCT2_VERSION + "v" kOpenRCT2Version #endif #if defined(OPENRCT2_BRANCH) || defined(OPENRCT2_COMMIT_SHA1_SHORT) || !defined(NDEBUG) " (" diff --git a/src/openrct2/Version.h b/src/openrct2/Version.h index 5519257d49de..02390cdedac9 100644 --- a/src/openrct2/Version.h +++ b/src/openrct2/Version.h @@ -12,7 +12,7 @@ #include #define OPENRCT2_NAME "OpenRCT2" -#define OPENRCT2_VERSION "0.4.18" +#define kOpenRCT2Version "0.4.18" #if defined(__amd64__) || defined(_M_AMD64) #define OPENRCT2_ARCHITECTURE "x86-64" diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index ab12b88c4a8a..64639edde733 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -66,21 +66,21 @@ GameActions::Result BannerRemoveAction::Query() const if (bannerElement == nullptr) { LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); @@ -105,21 +105,21 @@ GameActions::Result BannerRemoveAction::Execute() const if (bannerElement == nullptr) { LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 669b7cce45ac..10b78d19d760 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -92,7 +92,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", index); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 8251910049b2..7a8c96fa0af7 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -93,7 +93,7 @@ GameActions::Result BannerSetStyleAction::Query() const if (tileElement->AsBanner() == nullptr) { LOG_ERROR("Tile element was not a banner."); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } break; default: @@ -125,7 +125,7 @@ GameActions::Result BannerSetStyleAction::Execute() const if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } switch (_type) diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index 63c256e90da6..4b79c27d5a49 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -81,7 +81,7 @@ GameActions::Result ClearAction::QueryExecute(bool executing) const auto noValidTiles = true; auto error = GameActions::Status::Ok; - StringId errorMessage = STR_NONE; + StringId errorMessage = kStringIdNone; money64 totalCost = 0; auto validRange = ClampRangeWithinMap(_range); diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 7188613a2002..062be3aea108 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -141,7 +141,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const // Check if there is something on the path already if (pathElement->HasAddition()) { - return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } } return res; diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 1c044de47a69..7f8c5e35542b 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -87,7 +87,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST)) { LOG_WARNING("Tried to remove non ghost during ghost removal."); - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = GameActions::Result(); res.Position = _loc; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 406d1c28d761..0d39c07b49a4 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -219,7 +219,7 @@ GameActions::Result FootpathPlaceAction::ElementUpdateQuery(PathElement* pathEle if (GetFlags() & GAME_COMMAND_FLAG_GHOST && !pathElement->IsGhost()) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } return res; } @@ -283,7 +283,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result if (!MapCheckCapacityAndReorganise(_loc)) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } res.Cost = 12.00_GBP; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 603eb97755d5..61e2ccc3161f 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -119,7 +119,7 @@ GameActions::Result FootpathRemoveAction::Execute() const } else { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone); } res.Cost += GetRefundPrice(footpathElement); diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index d70cdb766689..78c65fe1b6c6 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -259,10 +259,10 @@ template struct GameActionBase : GameAction { public: - static constexpr GameCommand TYPE = TType; + static constexpr GameCommand kType = TType; GameActionBase() - : GameAction(TYPE) + : GameAction(kType) { } }; diff --git a/src/openrct2/actions/GameActionRegistry.cpp b/src/openrct2/actions/GameActionRegistry.cpp index 04b9d6bb7e44..810c3a9a3a80 100644 --- a/src/openrct2/actions/GameActionRegistry.cpp +++ b/src/openrct2/actions/GameActionRegistry.cpp @@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions static constexpr void Register(GameActionRegistry& registry, const char* name) { GameActionFactory factory = []() -> GameAction* { return new T(); }; - Register(registry, factory, name); + Register(registry, factory, name); } static constexpr GameActionRegistry BuildRegistry() diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 137729e0f638..6c2065050d5d 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -57,8 +57,8 @@ namespace OpenRCT2::GameActions using StringVariant = std::variant; OpenRCT2::GameActions::Status Error = OpenRCT2::GameActions::Status::Ok; - StringVariant ErrorTitle = STR_NONE; - StringVariant ErrorMessage = STR_NONE; + StringVariant ErrorTitle = kStringIdNone; + StringVariant ErrorMessage = kStringIdNone; std::array ErrorMessageArgs{}; CoordsXYZ Position = { kLocationNull, kLocationNull, kLocationNull }; money64 Cost = 0; diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index 8620da0af21c..6333df89f48c 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -46,7 +46,7 @@ GameActions::Result GuestSetFlagsAction::Query() const if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } return GameActions::Result(); } @@ -57,7 +57,7 @@ GameActions::Result GuestSetFlagsAction::Execute() const if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } peep->PeepFlags = _newFlags; diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 73d055cee521..665c38970b43 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -58,7 +58,7 @@ void GuestSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result GuestSetNameAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -67,7 +67,7 @@ GameActions::Result GuestSetNameAction::Query() const if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } return GameActions::Result(); @@ -79,7 +79,7 @@ GameActions::Result GuestSetNameAction::Execute() const if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } auto curName = guest->GetName(); @@ -90,7 +90,7 @@ GameActions::Result GuestSetNameAction::Execute() const if (!guest->SetName(_name)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); } // Easter egg functions are for guests only diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index a89432574024..203a2bb13d0e 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -114,7 +114,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& if (_setting >= LandBuyRightSetting::Count) { LOG_ERROR("Invalid land buying setting %u", _setting); - return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return GameActions::Result(GameActions::Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); @@ -122,7 +122,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& { LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); return GameActions::Result( - GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + GameActions::Status::InvalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto res = GameActions::Result(); @@ -138,7 +138,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& || (surfaceElement->GetOwnership() & OWNERSHIP_AVAILABLE) == 0) { return GameActions::Result( - GameActions::Status::NotOwned, _ErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); + GameActions::Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); } if (isExecuting) { @@ -158,7 +158,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& || (surfaceElement->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) == 0) { return GameActions::Result( - GameActions::Status::NotOwned, _ErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); + GameActions::Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); } if (isExecuting) @@ -172,6 +172,6 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& default: LOG_ERROR("Invalid land buying setting %u", _setting); - return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return GameActions::Result(GameActions::Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index d0df59ae0fb9..7f2cf7a91837 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -24,7 +24,7 @@ class LandBuyRightsAction final : public GameActionBaseAsPath()->IsLevelCrossing(oldCoords)) { - return GameActions::Result(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone); } TileElement* tileElement = CheckFloatingStructures(reinterpret_cast(surfaceElement), _height); if (tileElement != nullptr) { - auto res = GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -212,7 +212,7 @@ StringId LandSetHeightAction::CheckParameters() const return STR_TOO_HIGH; } - return STR_NONE; + return kStringIdNone; } TileElement* LandSetHeightAction::CheckTreeObstructions() const @@ -297,7 +297,7 @@ StringId LandSetHeightAction::CheckRideSupports() const return STR_SUPPORTS_CANT_BE_EXTENDED; } } - return STR_NONE; + return kStringIdNone; } TileElement* LandSetHeightAction::CheckFloatingStructures(TileElement* surfaceElement, uint8_t zCorner) const @@ -327,7 +327,7 @@ TileElement* LandSetHeightAction::CheckFloatingStructures(TileElement* surfaceEl money64 LandSetHeightAction::GetSurfaceHeightChangeCost(SurfaceElement* surfaceElement) const { money64 cost{ 0 }; - for (Direction i : ALL_DIRECTIONS) + for (Direction i : kAllDirections) { int32_t cornerHeight = TileElementGetCornerHeight(surfaceElement, i); cornerHeight -= MapGetCornerHeight(_height, _style & kTileSlopeMask, i); diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 4c7edd8ef72a..a95a3d057446 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -87,7 +87,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_NONE, STR_LAND_NOT_FOR_SALE); + return GameActions::Result(GameActions::Status::NotInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE); } // Game command modified to accept selection size diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 2404959504f6..58a5f8322f7b 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -346,7 +346,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const int32_t centreZ = TileElementHeight(_coords); auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[_isLowering ? 0 : 1]; + res.ErrorTitle = kErrorTitles[_isLowering ? 0 : 1]; res.Expenditure = ExpenditureType::Landscaping; res.Position = { _coords.x, _coords.y, centreZ }; diff --git a/src/openrct2/actions/LandSmoothAction.h b/src/openrct2/actions/LandSmoothAction.h index efefffb5b3e2..1b367c71bef7 100644 --- a/src/openrct2/actions/LandSmoothAction.h +++ b/src/openrct2/actions/LandSmoothAction.h @@ -19,7 +19,7 @@ class LandSmoothAction final : public GameActionBasetiles.empty()) { LOG_ERROR("Invalid large scenery object, sceneryType = %u", _sceneryType); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } int16_t maxHeight = GetMaxSurfaceHeight(sceneryEntry->tiles); diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 2d2a0bdb330d..e21cc0abbe97 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -153,7 +153,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const if (sceneryEntry == nullptr) { LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, kStringIdNone); } tileElement->RemoveBannerEntry(); diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index ef33766932c5..96f2768bb74e 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -100,7 +100,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) LOG_ERROR( "Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z, _loc.direction, _tileIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(largeElement->IsGhost())) @@ -113,7 +113,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (sceneryEntry == nullptr) { LOG_ERROR("Scenery element doesn't have scenery entry"); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } // Work out the base tile coordinates (Tile with index 0) auto rotatedBaseCoordsOffset = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction), @@ -147,7 +147,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) LOG_ERROR( "Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) { diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index ad6127461648..52b0d96d38f1 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -33,7 +33,7 @@ using namespace OpenRCT2::TrackMetaData; // clang-format off /** rct2: 0x00993CE9 */ -static constexpr uint8_t Byte993CE9[] = { +static constexpr uint8_t kByte993CE9[] = { 0xFF, 0xE0, 0xFF, 14, 0, 1, 2, 6, 2, 4, 5, @@ -42,7 +42,7 @@ static constexpr uint8_t Byte993CE9[] = { }; /** rct2: 0x00993CFC */ -static constexpr uint8_t Byte993CFC[] = { +static constexpr uint8_t kByte993CFC[] = { 5, 12, 0xFF, 0xFF, 9, 0, 0xFF, 0xFF, 13, 4, 0xFF, 0xFF, @@ -50,7 +50,7 @@ static constexpr uint8_t Byte993CFC[] = { }; /** rct2: 0x00993D0C */ -static constexpr uint8_t Byte993D0C[] = { +static constexpr uint8_t kByte993D0C[] = { 3, 0, 0xFF, 0xFF, 0, 1, 0xFF, 0xFF, 1, 2, 0xFF, 0xFF, @@ -253,10 +253,10 @@ GameActions::Result MazeSetTrackAction::Execute() const if (!_initialPlacement) { - segmentOffset = Byte993CE9[(_loc.direction + segmentOffset)]; + segmentOffset = kByte993CE9[(_loc.direction + segmentOffset)]; tileElement->AsTrack()->MazeEntrySubtract(1 << segmentOffset); - uint8_t temp_edx = Byte993CFC[segmentOffset]; + uint8_t temp_edx = kByte993CFC[segmentOffset]; if (temp_edx != 0xFF) { auto previousElementLoc = CoordsXY{ _loc }.ToTileStart() - CoordsDirectionDelta[_loc.direction]; @@ -311,7 +311,7 @@ GameActions::Result MazeSetTrackAction::Execute() const { tileElement->AsTrack()->MazeEntryAdd(1 << segmentBit); - uint32_t direction1 = Byte993D0C[segmentBit]; + uint32_t direction1 = kByte993D0C[segmentBit]; auto nextElementLoc = previousSegment.ToTileStart() + CoordsDirectionDelta[direction1]; TileElement* tmp_tileElement = MapGetTrackElementAtOfTypeFromRide( @@ -319,7 +319,7 @@ GameActions::Result MazeSetTrackAction::Execute() const if (tmp_tileElement != nullptr) { - uint8_t edx11 = Byte993CFC[segmentBit]; + uint8_t edx11 = kByte993CFC[segmentBit]; tmp_tileElement->AsTrack()->MazeEntryAdd(1 << (edx11)); } diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.cpp b/src/openrct2/actions/ParkEntrancePlaceAction.cpp index 9867ab78a94e..19ddcf144b21 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.cpp +++ b/src/openrct2/actions/ParkEntrancePlaceAction.cpp @@ -58,7 +58,7 @@ GameActions::Result ParkEntrancePlaceAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -111,7 +111,7 @@ GameActions::Result ParkEntrancePlaceAction::Query() const EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false); if (entranceElement != nullptr) { - return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index 49a8f687ffb5..906f718f3400 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -45,7 +45,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = GameActions::Result(); @@ -60,7 +60,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const if (ParkEntranceGetIndex(_loc) == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } return res; } @@ -76,7 +76,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const if (entranceIndex == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto& gameState = GetGameState(); diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index d10a5764bb70..7257fa492531 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -46,12 +46,12 @@ GameActions::Result ParkSetEntranceFeeAction::Query() const if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) != 0) { LOG_ERROR("Can't set park entrance fee because the park has no money"); - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (!Park::EntranceFeeUnlocked()) { LOG_ERROR("Park entrance fee is locked"); - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE) { diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index ccc1efc2b6ef..ac6f34ec0ee4 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -51,7 +51,7 @@ GameActions::Result ParkSetParameterAction::Query() const } auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[EnumValue(_parameter)]; + res.ErrorTitle = kErrorTitles[EnumValue(_parameter)]; return res; } @@ -85,6 +85,6 @@ GameActions::Result ParkSetParameterAction::Execute() const } auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[EnumValue(_parameter)]; + res.ErrorTitle = kErrorTitles[EnumValue(_parameter)]; return res; } diff --git a/src/openrct2/actions/ParkSetParameterAction.h b/src/openrct2/actions/ParkSetParameterAction.h index 7a4f598c1f90..cfbcd9126a0a 100644 --- a/src/openrct2/actions/ParkSetParameterAction.h +++ b/src/openrct2/actions/ParkSetParameterAction.h @@ -25,11 +25,11 @@ class ParkSetParameterAction final : public GameActionBase= MAX_ENTITIES || _entityId.IsNull()) + if (_entityId.ToUnderlying() >= kMaxEntities || _entityId.IsNull()) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } if (!_loc.IsNull() && !LocationValid(_loc)) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto* const peep = TryGetEntity(_entityId); if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -74,7 +74,7 @@ GameActions::Result PeepPickupAction::Query() const res.Position = peep->GetLocation(); if (!peep->CanBePickedUp()) { - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } Peep* existing = NetworkGetPickupPeep(_owner); if (existing != nullptr) @@ -99,7 +99,7 @@ GameActions::Result PeepPickupAction::Query() const res.Position = _loc; if (NetworkGetPickupPeep(_owner) != peep) { - return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != GameActions::Status::Ok) @@ -109,7 +109,7 @@ GameActions::Result PeepPickupAction::Query() const break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } @@ -120,7 +120,7 @@ GameActions::Result PeepPickupAction::Execute() const if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -178,7 +178,7 @@ GameActions::Result PeepPickupAction::Execute() const break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index fd66c785da3b..71f7452defad 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -47,7 +47,7 @@ GameActions::Result PeepSpawnPlaceAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone); } auto res = GameActions::Result(); diff --git a/src/openrct2/actions/ResultWithMessage.h b/src/openrct2/actions/ResultWithMessage.h index fda9921ed23c..f78b8b5b7579 100644 --- a/src/openrct2/actions/ResultWithMessage.h +++ b/src/openrct2/actions/ResultWithMessage.h @@ -14,10 +14,10 @@ struct ResultWithMessage { bool Successful{}; - StringId Message = STR_NONE; + StringId Message = kStringIdNone; bool HasMessage() const { - return Message != STR_NONE; + return Message != kStringIdNone; } }; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 235106cf616c..6a081539cc3a 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -117,7 +117,7 @@ GameActions::Result RideCreateAction::Query() const const auto* presetList = rideEntry->vehicle_preset_list; if ((presetList->count > 0 && presetList->count != 255) && _colour2 >= presetList->count) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } auto res = GameActions::Result(); @@ -206,7 +206,7 @@ GameActions::Result RideCreateAction::Execute() const if (!(gameState.Park.Flags & PARK_FLAGS_NO_MONEY)) { - for (auto i = 0; i < RCT2::ObjectLimits::MaxShopItemsPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++) { ride->price[i] = rtd.DefaultPrices[i]; } @@ -244,7 +244,7 @@ GameActions::Result RideCreateAction::Execute() const } } - for (auto i = 0; i < RCT2::ObjectLimits::MaxShopItemsPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++) { if (rideEntry->shop_item[i] != ShopItem::None) { diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index a878603ff0ae..165f7b8d9f8b 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -242,15 +242,15 @@ money64 RideDemolishAction::DemolishTracks() const } else { - static constexpr CoordsXY DirOffsets[] = { + static constexpr CoordsXY kDirOffsets[] = { { 0, 0 }, { 0, 16 }, { 16, 16 }, { 16, 0 }, }; - for (Direction dir : ALL_DIRECTIONS) + for (Direction dir : kAllDirections) { - const CoordsXYZ off = { DirOffsets[dir], 0 }; + const CoordsXYZ off = { kDirOffsets[dir], 0 }; money64 removePrice = MazeRemoveTrack({ location + off, dir }); if (removePrice != kMoney64Undefined) { diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index b2f8655391e7..79367b7f0348 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -77,12 +77,12 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone); } if (!LocationValid(_loc)) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index b4e1eb9af471..f294c373d6d7 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -69,7 +69,7 @@ GameActions::Result RideSetPriceAction::Query() const if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_EMPTY); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } return GameActions::Result(); @@ -98,7 +98,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_EMPTY); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } if (!ride->overall_view.IsNull()) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index aba738295fc7..996a00365ecc 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -152,7 +152,7 @@ GameActions::Result RideSetSettingAction::Query() const if (!GetGameState().Cheats.allowArbitraryRideTypeChanges) { LOG_ERROR("Arbitrary ride type changes not allowed."); - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone); } break; default: diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index b3d4e86c866f..e6b5eced97ad 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -73,7 +73,7 @@ GameActions::Result RideSetStatusAction::Query() const LOG_ERROR("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = kStringIdNone; return res; } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index eae246e1e3bb..b090c1c407a9 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -28,7 +28,7 @@ using namespace OpenRCT2; -constexpr static StringId SetVehicleTypeErrorTitle[] = { +constexpr static StringId kSetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, STR_RIDE_SET_VEHICLE_TYPE_FAIL, @@ -68,7 +68,7 @@ GameActions::Result RideSetVehicleAction::Query() const { LOG_ERROR("Invalid ride vehicle type %d", _type); } - auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; + auto errTitle = kSetVehicleTypeErrorTitle[EnumValue(_type)]; auto ride = GetRide(_rideIndex); if (ride == nullptr) @@ -104,7 +104,7 @@ GameActions::Result RideSetVehicleAction::Query() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for _value %d", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } // Validate preset @@ -127,7 +127,7 @@ GameActions::Result RideSetVehicleAction::Query() const GameActions::Result RideSetVehicleAction::Execute() const { - auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; + auto errTitle = kSetVehicleTypeErrorTitle[EnumValue(_type)]; auto ride = GetRide(_rideIndex); if (ride == nullptr) { @@ -155,7 +155,7 @@ GameActions::Result RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } uint8_t clampValue = _value; static_assert(sizeof(clampValue) == sizeof(ride->proposed_num_cars_per_train)); @@ -178,7 +178,7 @@ GameActions::Result RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } RideSetVehicleColoursToRandomPreset(*ride, _colour); @@ -201,7 +201,7 @@ GameActions::Result RideSetVehicleAction::Execute() const default: LOG_ERROR("Invalid ride vehicle setting %d", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } ride->num_circuits = 1; diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index fa5574363454..64a4b150ef92 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -49,7 +49,7 @@ GameActions::Result SignSetNameAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } return GameActions::Result(); } @@ -60,7 +60,7 @@ GameActions::Result SignSetNameAction::Execute() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } if (!_name.empty()) diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 94535f233983..ca19498d8cf3 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -56,7 +56,7 @@ GameActions::Result SignSetStyleAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (_isLarge) @@ -65,13 +65,13 @@ GameActions::Result SignSetStyleAction::Query() const if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (tileElement->GetType() != TileElementType::LargeScenery) { LOG_ERROR( "Tile element has type %u, expected %d (LargeScenery)", tileElement->GetType(), TileElementType::LargeScenery); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } else @@ -81,7 +81,7 @@ GameActions::Result SignSetStyleAction::Query() const if (wallElement == nullptr) { LOG_ERROR("Wall element not found for bannerIndex", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } @@ -94,7 +94,7 @@ GameActions::Result SignSetStyleAction::Execute() const if (banner == nullptr) { LOG_ERROR("Invalid banner id %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } CoordsXY coords = banner->position.ToCoordsXY(); @@ -106,7 +106,7 @@ GameActions::Result SignSetStyleAction::Execute() const { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } } else diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index 4e3202242266..0d2ff36d6433 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -97,7 +97,7 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting) if (sceneryElement == nullptr) { LOG_ERROR("Small scenery not found at: x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(sceneryElement->IsGhost())) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 6846b722cb48..acb171908677 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -39,7 +39,7 @@ void StaffFireAction::Serialise(DataSerialiser& stream) GameActions::Result StaffFireAction::Query() const { - if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull()) + if (_spriteId.ToUnderlying() >= kMaxEntities || _spriteId.IsNull()) { LOG_ERROR("Invalid spriteId %u", _spriteId); return GameActions::Result( @@ -55,11 +55,11 @@ GameActions::Result StaffFireAction::Query() const if (staff->State == PeepState::Fixing) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone); } else if (staff->State == PeepState::Inspecting) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone); } return GameActions::Result(); diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 42de88d8a9be..32428ceaf82c 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -46,7 +46,7 @@ void StaffSetCostumeAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetCostumeAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 02553e497fe5..2dea03bb7080 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -49,7 +49,7 @@ void StaffSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetNameAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( @@ -85,7 +85,7 @@ GameActions::Result StaffSetNameAction::Execute() const if (!staff->SetName(_name)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); } GfxInvalidateScreen(); diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index f301dfc43f63..9bb33b41bb6d 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -45,7 +45,7 @@ void StaffSetOrdersAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetOrdersAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index e990603a2fc0..0476492c13bb 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -84,7 +84,7 @@ GameActions::Result TrackDesignAction::Query() const auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); @@ -158,7 +158,7 @@ GameActions::Result TrackDesignAction::Execute() const auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 592388f56bc0..dffddd7d036d 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -103,7 +103,7 @@ GameActions::Result TrackPlaceAction::Query() const if (_rideType != ride->type && !gameState.Cheats.allowArbitraryRideTypeChanges) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone); } if (_rideType > RIDE_TYPE_COUNT) diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 3fc18438535a..ba362afdb186 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -75,7 +75,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con if (_brakeSpeed > kMaximumTrackSpeed) { LOG_WARNING("Invalid speed for track, speed = %d", _brakeSpeed); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_SPEED_TOO_HIGH, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 7db7bbd276f4..158067f1a550 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -114,7 +114,7 @@ GameActions::Result WallPlaceAction::Query() const if (_edge > 3) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } uint8_t edgeSlope = 0; @@ -536,7 +536,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( int32_t direction = tileElement->GetDirection(); if (_edge == direction) { - auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -544,7 +544,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( } if (tileElement->GetOccupiedQuadrants() == 0) continue; - auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); switch (elementType) { case TileElementType::Entrance: diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index dd5b90c541df..7293988486c5 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -92,7 +92,7 @@ GameActions::Result WallSetColourAction::Query() const LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (_primaryColour >= COLOUR_COUNT) @@ -110,7 +110,7 @@ GameActions::Result WallSetColourAction::Query() const if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Tertiary colour invalid: colour = %d", _tertiaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } return res; @@ -130,7 +130,7 @@ GameActions::Result WallSetColourAction::Execute() const { LOG_ERROR( "Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) @@ -144,7 +144,7 @@ GameActions::Result WallSetColourAction::Execute() const LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } wallElement->SetPrimaryColour(_primaryColour); diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 0296a3f4e740..1940e7588502 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -55,25 +55,25 @@ GameActions::Result WaterSetHeightAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gameState.Cheats.sandboxMode && gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); } StringId errorMsg = CheckParameters(); - if (errorMsg != STR_NONE) + if (errorMsg != kStringIdNone) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, errorMsg); + return GameActions::Result(GameActions::Status::InvalidParameters, kStringIdNone, errorMsg); } if (!LocationValid(_coords)) { - return GameActions::Result(GameActions::Status::NotOwned, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); + return GameActions::Result(GameActions::Status::NotOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gameState.Cheats.sandboxMode) { if (!MapIsLocationInPark(_coords)) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } } @@ -165,5 +165,5 @@ StringId WaterSetHeightAction::CheckParameters() const return STR_TOO_HIGH; } - return STR_NONE; + return kStringIdNone; } diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 92dac3b61ffe..437bab483650 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -503,9 +503,9 @@ namespace OpenRCT2::Audio float DStoMixerPan(int32_t pan) { - constexpr int32_t DSBPAN_LEFT = -10000; - constexpr int32_t DSBPAN_RIGHT = 10000; - return ((static_cast(pan) + -DSBPAN_LEFT) / DSBPAN_RIGHT) / 2; + constexpr int32_t kDSBPanLeft = -10000; + constexpr int32_t kDSBPanRight = 10000; + return ((static_cast(pan) + -kDSBPanLeft) / kDSBPanRight) / 2; } double DStoMixerRate(int32_t frequency) diff --git a/src/openrct2/command_line/CommandLine.cpp b/src/openrct2/command_line/CommandLine.cpp index 2e2cd7376683..fd0f56ba8dba 100644 --- a/src/openrct2/command_line/CommandLine.cpp +++ b/src/openrct2/command_line/CommandLine.cpp @@ -95,8 +95,8 @@ bool CommandLineArgEnumerator::TryPopString(const char** result) namespace OpenRCT2::CommandLine { - constexpr const char* HelpText = "openrct2 -ha shows help for all commands. " - "openrct2 -h will show help and details for a given command."; + constexpr const char* kHelpText = "openrct2 -ha shows help for all commands. " + "openrct2 -h will show help and details for a given command."; static void PrintHelpFor(const CommandLineCommand* commands); static void PrintOptions(const CommandLineOptionDefinition* options); @@ -143,7 +143,7 @@ namespace OpenRCT2::CommandLine } else { - Console::WriteLine(HelpText); + Console::WriteLine(kHelpText); } } diff --git a/src/openrct2/command_line/CommandLine.hpp b/src/openrct2/command_line/CommandLine.hpp index edea0669be2c..88081bc7c2b2 100644 --- a/src/openrct2/command_line/CommandLine.hpp +++ b/src/openrct2/command_line/CommandLine.hpp @@ -87,10 +87,10 @@ enum CMDLINE_TYPE_STRING, }; -constexpr char NAC = '\0'; +constexpr char kNAC = '\0'; constexpr CommandLineExample kExampleTableEnd = CommandLineExample{ nullptr, nullptr }; -constexpr CommandLineOptionDefinition kOptionTableEnd = CommandLineOptionDefinition{ UINT8_MAX, nullptr, NAC, nullptr, +constexpr CommandLineOptionDefinition kOptionTableEnd = CommandLineOptionDefinition{ UINT8_MAX, nullptr, kNAC, nullptr, nullptr }; constexpr CommandLineCommand kCommandTableEnd = CommandLineCommand{ nullptr, nullptr, nullptr, nullptr, nullptr }; diff --git a/src/openrct2/command_line/ParkInfoCommands.cpp b/src/openrct2/command_line/ParkInfoCommands.cpp index 2038bb0e11e3..d952de391532 100644 --- a/src/openrct2/command_line/ParkInfoCommands.cpp +++ b/src/openrct2/command_line/ParkInfoCommands.cpp @@ -19,7 +19,7 @@ using namespace OpenRCT2; // clang-format off -static constexpr CommandLineOptionDefinition NoOptions[] +static constexpr CommandLineOptionDefinition kNoOptions[] { kOptionTableEnd }; @@ -28,7 +28,7 @@ static exitcode_t HandleObjectsInfo(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::ParkInfoCommands[]{ // Main commands - DefineCommand("objects", "", NoOptions, HandleObjectsInfo), + DefineCommand("objects", "", kNoOptions, HandleObjectsInfo), kCommandTableEnd }; diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index 8887e375214e..9f9fc56483bd 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -65,27 +65,27 @@ static u8string _rct2DataPath = {}; static bool _silentBreakpad = false; // clang-format off -static constexpr CommandLineOptionDefinition StandardOptions[] +static constexpr CommandLineOptionDefinition kStandardOptions[] { { CMDLINE_TYPE_SWITCH, &_help, 'h', "help", "show this help message and exit" }, { CMDLINE_TYPE_SWITCH, &_version, 'v', "version", "show version information and exit" }, { CMDLINE_TYPE_SWITCH, &_noInstall, 'n', "no-install", "do not install scenario if passed" }, { CMDLINE_TYPE_SWITCH, &_all, 'a', "all", "show help for all commands" }, - { CMDLINE_TYPE_SWITCH, &_about, NAC, "about", "show information about " OPENRCT2_NAME }, - { CMDLINE_TYPE_SWITCH, &_verbose, NAC, "verbose", "log verbose messages" }, - { CMDLINE_TYPE_SWITCH, &_headless, NAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, - { CMDLINE_TYPE_SWITCH, &_silentReplays, NAC, "silent-replays", "use unobtrusive replays" }, + { CMDLINE_TYPE_SWITCH, &_about, kNAC, "about", "show information about " OPENRCT2_NAME }, + { CMDLINE_TYPE_SWITCH, &_verbose, kNAC, "verbose", "log verbose messages" }, + { CMDLINE_TYPE_SWITCH, &_headless, kNAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, + { CMDLINE_TYPE_SWITCH, &_silentReplays, kNAC, "silent-replays", "use unobtrusive replays" }, #ifndef DISABLE_NETWORK - { CMDLINE_TYPE_INTEGER, &_port, NAC, "port", "port to use for hosting or joining a server" }, - { CMDLINE_TYPE_STRING, &_address, NAC, "address", "address to listen on when hosting a server" }, + { CMDLINE_TYPE_INTEGER, &_port, kNAC, "port", "port to use for hosting or joining a server" }, + { CMDLINE_TYPE_STRING, &_address, kNAC, "address", "address to listen on when hosting a server" }, #endif - { CMDLINE_TYPE_STRING, &_password, NAC, "password", "password needed to join the server" }, - { CMDLINE_TYPE_STRING, &_userDataPath, NAC, "user-data-path", "path to the user data directory (containing config.ini)" }, - { CMDLINE_TYPE_STRING, &_openrct2DataPath, NAC, "openrct2-data-path", "path to the OpenRCT2 data directory (containing languages)" }, - { CMDLINE_TYPE_STRING, &_rct1DataPath, NAC, "rct1-data-path", "path to the RollerCoaster Tycoon 1 data directory (containing data/csg1.dat)" }, - { CMDLINE_TYPE_STRING, &_rct2DataPath, NAC, "rct2-data-path", "path to the RollerCoaster Tycoon 2 data directory (containing data/g1.dat)" }, + { CMDLINE_TYPE_STRING, &_password, kNAC, "password", "password needed to join the server" }, + { CMDLINE_TYPE_STRING, &_userDataPath, kNAC, "user-data-path", "path to the user data directory (containing config.ini)" }, + { CMDLINE_TYPE_STRING, &_openrct2DataPath, kNAC, "openrct2-data-path", "path to the OpenRCT2 data directory (containing languages)" }, + { CMDLINE_TYPE_STRING, &_rct1DataPath, kNAC, "rct1-data-path", "path to the RollerCoaster Tycoon 1 data directory (containing data/csg1.dat)" }, + { CMDLINE_TYPE_STRING, &_rct2DataPath, kNAC, "rct2-data-path", "path to the RollerCoaster Tycoon 2 data directory (containing data/g1.dat)" }, #ifdef USE_BREAKPAD - { CMDLINE_TYPE_SWITCH, &_silentBreakpad, NAC, "silent-breakpad", "make breakpad crash reporting silent" }, + { CMDLINE_TYPE_SWITCH, &_silentBreakpad, kNAC, "silent-breakpad", "make breakpad crash reporting silent" }, #endif // USE_BREAKPAD kOptionTableEnd }; @@ -121,21 +121,21 @@ const CommandLineCommand CommandLine::RootCommands[] { // Main commands #ifndef DISABLE_HTTP - DefineCommand("", "", StandardOptions, HandleNoCommand ), - DefineCommand("edit", "", StandardOptions, HandleCommandEdit ), + DefineCommand("", "", kStandardOptions, HandleNoCommand ), + DefineCommand("edit", "", kStandardOptions, HandleCommandEdit ), #else - DefineCommand("", "", StandardOptions, HandleNoCommand ), - DefineCommand("edit", "", StandardOptions, HandleCommandEdit ), + DefineCommand("", "", kStandardOptions, HandleNoCommand ), + DefineCommand("edit", "", kStandardOptions, HandleCommandEdit ), #endif - DefineCommand("intro", "", StandardOptions, HandleCommandIntro ), + DefineCommand("intro", "", kStandardOptions, HandleCommandIntro ), #ifndef DISABLE_NETWORK - DefineCommand("host", "", StandardOptions, HandleCommandHost ), - DefineCommand("join", "", StandardOptions, HandleCommandJoin ), + DefineCommand("host", "", kStandardOptions, HandleCommandHost ), + DefineCommand("join", "", kStandardOptions, HandleCommandJoin ), #endif - DefineCommand("set-rct2", "", StandardOptions, HandleCommandSetRCT2), - DefineCommand("convert", " ", StandardOptions, CommandLine::HandleCommandConvert), - DefineCommand("scan-objects", "", StandardOptions, HandleCommandScanObjects), - DefineCommand("handle-uri", "openrct2://.../", StandardOptions, CommandLine::HandleCommandUri), + DefineCommand("set-rct2", "", kStandardOptions, HandleCommandSetRCT2), + DefineCommand("convert", " ", kStandardOptions, CommandLine::HandleCommandConvert), + DefineCommand("scan-objects", "", kStandardOptions, HandleCommandScanObjects), + DefineCommand("handle-uri", "openrct2://.../", kStandardOptions, CommandLine::HandleCommandUri), #if defined(_WIN32) DefineCommand("register-shell", "", RegisterShellOptions, HandleCommandRegisterShell), @@ -455,15 +455,15 @@ static void PrintVersion() Console::WriteFormat("Network version: %s", NetworkGetVersion().c_str()); Console::WriteLine(); #ifdef ENABLE_SCRIPTING - Console::WriteFormat("Plugin API version: %d", OpenRCT2::Scripting::OPENRCT2_PLUGIN_API_VERSION); + Console::WriteFormat("Plugin API version: %d", OpenRCT2::Scripting::kPluginApiVersion); Console::WriteLine(); #else Console::WriteFormat("Plugin API not enabled in this build"); Console::WriteLine(); #endif - Console::WriteFormat("Current park file version: %d", OpenRCT2::PARK_FILE_CURRENT_VERSION); + Console::WriteFormat("Current park file version: %d", OpenRCT2::kParkFileCurrentVersion); Console::WriteLine(); - Console::WriteFormat("Minimum park file version: %d", OpenRCT2::PARK_FILE_MIN_VERSION); + Console::WriteFormat("Minimum park file version: %d", OpenRCT2::kParkFileMinVersion); Console::WriteLine(); #ifdef USE_BREAKPAD Console::WriteFormat("With breakpad support enabled"); diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index 0414d8f1a3de..d9ef9a4684db 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -15,18 +15,18 @@ using namespace OpenRCT2; static ScreenshotOptions _options; // clang-format off -static constexpr CommandLineOptionDefinition ScreenshotOptionsDef[] +static constexpr CommandLineOptionDefinition kScreenshotOptionsDef[] { - { CMDLINE_TYPE_INTEGER, &_options.weather, NAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, - { CMDLINE_TYPE_SWITCH, &_options.hide_guests, NAC, "no-peeps", "hide peeps" }, - { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, NAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, - { CMDLINE_TYPE_SWITCH, &_options.clear_grass, NAC, "clear-grass", "set all grass to be clear of weeds" }, - { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, NAC, "mowed-grass", "set all grass to be mowed" }, - { CMDLINE_TYPE_SWITCH, &_options.water_plants, NAC, "water-plants", "water plants for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, NAC, "fix-vandalism", "fix vandalism for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.remove_litter, NAC, "remove-litter", "remove litter for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, NAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, - { CMDLINE_TYPE_SWITCH, &_options.transparent, NAC, "transparent", "make the background transparent" }, + { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, + { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, + { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, + { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, + { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, + { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, + { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, kOptionTableEnd }; @@ -35,8 +35,8 @@ static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::ScreenshotCommands[] { // Main commands - DefineCommand("", " [ ]", ScreenshotOptionsDef, HandleScreenshot), - DefineCommand("", " giant ", ScreenshotOptionsDef, HandleScreenshot), + DefineCommand("", " [ ]", kScreenshotOptionsDef, HandleScreenshot), + DefineCommand("", " giant ", kScreenshotOptionsDef, HandleScreenshot), kCommandTableEnd }; // clang-format on diff --git a/src/openrct2/command_line/SpriteCommands.cpp b/src/openrct2/command_line/SpriteCommands.cpp index 608fae7f698d..9998f7badb0f 100644 --- a/src/openrct2/command_line/SpriteCommands.cpp +++ b/src/openrct2/command_line/SpriteCommands.cpp @@ -25,7 +25,7 @@ ImportMode gSpriteMode = ImportMode::Default; static const char* _mode; // clang-format off -static constexpr CommandLineOptionDefinition SpriteOptions[] +static constexpr CommandLineOptionDefinition kSpriteOptions[] { { CMDLINE_TYPE_STRING, &_mode, 'm', "mode", "the type of sprite conversion <" SZ_DEFAULT "|" SZ_CLOSEST "|" SZ_DITHERING ">" }, kOptionTableEnd @@ -36,14 +36,14 @@ static exitcode_t HandleSprite(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::SpriteCommands[] { // Main commands - DefineCommand("append", " [x_offset y_offset]", SpriteOptions, HandleSprite), - DefineCommand("build", " [silent]", SpriteOptions, HandleSprite), - DefineCommand("combine", " ", SpriteOptions, HandleSprite), - DefineCommand("create", "", SpriteOptions, HandleSprite), - DefineCommand("details", " [idx]", SpriteOptions, HandleSprite), - DefineCommand("export", " ", SpriteOptions, HandleSprite), - DefineCommand("exportall", " ", SpriteOptions, HandleSprite), - DefineCommand("exportalldat", " ", SpriteOptions, HandleSprite), + DefineCommand("append", " [x_offset y_offset]", kSpriteOptions, HandleSprite), + DefineCommand("build", " [silent]", kSpriteOptions, HandleSprite), + DefineCommand("combine", " ", kSpriteOptions, HandleSprite), + DefineCommand("create", "", kSpriteOptions, HandleSprite), + DefineCommand("details", " [idx]", kSpriteOptions, HandleSprite), + DefineCommand("export", " ", kSpriteOptions, HandleSprite), + DefineCommand("exportall", " ", kSpriteOptions, HandleSprite), + DefineCommand("exportalldat", " ", kSpriteOptions, HandleSprite), kCommandTableEnd }; diff --git a/src/openrct2/core/BitSet.hpp b/src/openrct2/core/BitSet.hpp index 8872860d5d15..232aba9e7ed3 100644 --- a/src/openrct2/core/BitSet.hpp +++ b/src/openrct2/core/BitSet.hpp @@ -23,19 +23,19 @@ namespace OpenRCT2 { namespace BitSet { - static constexpr size_t BitsPerByte = std::numeric_limits>::digits; + static constexpr size_t kBitsPerByte = std::numeric_limits>::digits; template static constexpr size_t ByteAlignBits() { - const auto reminder = TNumBits % BitsPerByte; + const auto reminder = TNumBits % kBitsPerByte; if constexpr (reminder == 0u) { return TNumBits; } else { - return TNumBits + (BitsPerByte - (TNumBits % BitsPerByte)); + return TNumBits + (kBitsPerByte - (TNumBits % kBitsPerByte)); } } @@ -59,7 +59,7 @@ namespace OpenRCT2 } else { - const auto numBytes = numBits / BitsPerByte; + const auto numBytes = numBits / kBitsPerByte; auto mask = 1u; while (mask < numBytes) { @@ -70,14 +70,14 @@ namespace OpenRCT2 } template - static constexpr size_t ComputeBlockCount() + static constexpr size_t ComputekBlockCount() { size_t numBits = TNumBits; size_t numBlocks = 0; while (numBits > 0) { numBlocks++; - numBits -= std::min(TBlockSizeBytes * BitsPerByte, numBits); + numBits -= std::min(TBlockSizeBytes * kBitsPerByte, numBits); } return numBlocks; } @@ -149,20 +149,20 @@ namespace OpenRCT2 using StorageBlockType = typename Detail::BitSet::storage_block_type_aligned::value_type; - static constexpr size_t BlockByteSize = sizeof(StorageBlockType); - static constexpr size_t BlockBitSize = BlockByteSize * Detail::BitSet::BitsPerByte; - static constexpr size_t BlockCount = Detail::BitSet::ComputeBlockCount(); - static constexpr size_t CapacityBits = BlockCount * BlockBitSize; + static constexpr size_t kBlockByteSize = sizeof(StorageBlockType); + static constexpr size_t kBlockBitSize = kBlockByteSize * Detail::BitSet::kBitsPerByte; + static constexpr size_t kBlockCount = Detail::BitSet::ComputekBlockCount(); + static constexpr size_t kCapacityBits = kBlockCount * kBlockBitSize; - static constexpr StorageBlockType BlockValueZero = StorageBlockType{ 0u }; - static constexpr StorageBlockType BlockValueOne = StorageBlockType{ 1u }; - static constexpr StorageBlockType BlockValueMask = static_cast(~BlockValueZero); + static constexpr StorageBlockType kBlockValueZero = StorageBlockType{ 0u }; + static constexpr StorageBlockType kBlockValueOne = StorageBlockType{ 1u }; + static constexpr StorageBlockType kBlockValueMask = static_cast(~kBlockValueZero); - static constexpr bool RequiresTrim = TBitSize != CapacityBits; + static constexpr bool kRequiresTrim = TBitSize != kCapacityBits; public: using BlockType = StorageBlockType; - using Storage = std::array; + using Storage = std::array; // Proxy object to access the bits as single value. template @@ -183,9 +183,9 @@ namespace OpenRCT2 constexpr reference_base& operator=(const bool value) noexcept { if (!value) - _storage[_blockIndex] &= ~(BlockValueOne << _blockOffset); + _storage[_blockIndex] &= ~(kBlockValueOne << _blockOffset); else - _storage[_blockIndex] |= (BlockValueOne << _blockOffset); + _storage[_blockIndex] |= (kBlockValueOne << _blockOffset); return *this; } @@ -196,7 +196,7 @@ namespace OpenRCT2 constexpr bool value() const noexcept { - return (_storage[_blockIndex] & (BlockValueOne << _blockOffset)) != BlockValueZero; + return (_storage[_blockIndex] & (kBlockValueOne << _blockOffset)) != kBlockValueZero; } constexpr operator bool() const noexcept @@ -317,7 +317,7 @@ namespace OpenRCT2 constexpr size_t capacity() const noexcept { - return CapacityBits; + return kCapacityBits; } constexpr Storage& data() noexcept @@ -335,9 +335,9 @@ namespace OpenRCT2 const auto blockIndex = ComputeBlockIndex(index); const auto blockOffset = ComputeBlockOffset(index); if (!value) - _data[blockIndex] &= ~(BlockValueOne << blockOffset); + _data[blockIndex] &= ~(kBlockValueOne << blockOffset); else - _data[blockIndex] |= (BlockValueOne << blockOffset); + _data[blockIndex] |= (kBlockValueOne << blockOffset); return *this; } @@ -345,7 +345,7 @@ namespace OpenRCT2 { const auto blockIndex = ComputeBlockIndex(index); const auto blockOffset = ComputeBlockOffset(index); - return (_data[blockIndex] & (BlockValueOne << blockOffset)) != BlockValueZero; + return (_data[blockIndex] & (kBlockValueOne << blockOffset)) != kBlockValueZero; } constexpr bool operator[](const size_t index) const noexcept @@ -367,9 +367,9 @@ namespace OpenRCT2 { for (auto& data : _data) { - data ^= BlockValueMask; + data ^= kBlockValueMask; } - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { Trim(); } @@ -378,8 +378,8 @@ namespace OpenRCT2 constexpr BitSet& reset() noexcept { - std::fill(_data.begin(), _data.end(), BlockValueZero); - if constexpr (RequiresTrim) + std::fill(_data.begin(), _data.end(), kBlockValueZero); + if constexpr (kRequiresTrim) { Trim(); } @@ -422,7 +422,7 @@ namespace OpenRCT2 constexpr BitSet operator^(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -435,7 +435,7 @@ namespace OpenRCT2 constexpr BitSet operator|(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -448,7 +448,7 @@ namespace OpenRCT2 constexpr BitSet operator&(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -465,7 +465,7 @@ namespace OpenRCT2 { res._data[i] = ~res._data[i]; } - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { res.Trim(); } @@ -502,7 +502,7 @@ namespace OpenRCT2 { TOperator op{}; ((dst._data[TIndex] = op(dst._data[TIndex], src._data[TIndex])), ...); - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { dst.Trim(); } @@ -510,39 +510,39 @@ namespace OpenRCT2 static constexpr size_t ComputeBlockIndex(size_t idx) noexcept { - if constexpr (BlockCount == 1) + if constexpr (kBlockCount == 1) { return 0; } else { - return idx / BlockBitSize; + return idx / kBlockBitSize; } } static constexpr size_t ComputeBlockOffset(size_t idx) noexcept { - if constexpr (BlockCount == 1) + if constexpr (kBlockCount == 1) { return idx; } else { - return idx % BlockBitSize; + return idx % kBlockBitSize; } } // Some operations require to trim of the excess. constexpr void Trim() noexcept { - const auto byteIdx = TBitSize / BlockBitSize; - const auto bitIdx = TBitSize % BlockBitSize; + const auto byteIdx = TBitSize / kBlockBitSize; + const auto bitIdx = TBitSize % kBlockBitSize; if constexpr (bitIdx == 0) return; - auto trimMask = BlockValueMask; - trimMask <<= (BlockBitSize - bitIdx); - trimMask >>= (BlockBitSize - bitIdx); + auto trimMask = kBlockValueMask; + trimMask <<= (kBlockBitSize - bitIdx); + trimMask >>= (kBlockBitSize - bitIdx); _data[byteIdx] &= trimMask; } diff --git a/src/openrct2/core/ChecksumStream.cpp b/src/openrct2/core/ChecksumStream.cpp index d79dc10d34a7..77a4c5439105 100644 --- a/src/openrct2/core/ChecksumStream.cpp +++ b/src/openrct2/core/ChecksumStream.cpp @@ -20,7 +20,7 @@ namespace OpenRCT2 : _checksum(buf) { uint64_t* hash = reinterpret_cast(_checksum.data()); - *hash = Seed; + *hash = kSeed; } void ChecksumStream::Write(const void* buffer, uint64_t length) @@ -39,7 +39,7 @@ namespace OpenRCT2 #endif *hash ^= temp; - *hash *= Prime; + *hash *= kPrime; } } diff --git a/src/openrct2/core/ChecksumStream.h b/src/openrct2/core/ChecksumStream.h index 6d3174510d2d..f9064e6c92b8 100644 --- a/src/openrct2/core/ChecksumStream.h +++ b/src/openrct2/core/ChecksumStream.h @@ -23,8 +23,8 @@ namespace OpenRCT2 // FIXME: Move the checksum implementation out. std::array& _checksum; - static constexpr uint64_t Seed = 0xcbf29ce484222325ULL; - static constexpr uint64_t Prime = 0x00000100000001B3ULL; + static constexpr uint64_t kSeed = 0xcbf29ce484222325ULL; + static constexpr uint64_t kPrime = 0x00000100000001B3ULL; public: ChecksumStream(std::array& buf); diff --git a/src/openrct2/core/Compression.cpp b/src/openrct2/core/Compression.cpp index d902ab60d49b..03b78aebbf49 100644 --- a/src/openrct2/core/Compression.cpp +++ b/src/openrct2/core/Compression.cpp @@ -18,7 +18,7 @@ namespace OpenRCT2::Compression { - constexpr size_t CHUNK = 128 * 1024; + constexpr size_t kChunkSize = 128 * 1024; // Compress the source to gzip-compatible stream, write to dest. // Mainly used for compressing the crashdumps @@ -34,8 +34,8 @@ namespace OpenRCT2::Compression strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; + unsigned char in[kChunkSize]; + unsigned char out[kChunkSize]; int windowBits = 15; int GZIP_ENCODING = 16; ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, windowBits | GZIP_ENCODING, 8, Z_DEFAULT_STRATEGY); @@ -46,7 +46,7 @@ namespace OpenRCT2::Compression } do { - strm.avail_in = uInt(fread(in, 1, CHUNK, source)); + strm.avail_in = uInt(fread(in, 1, kChunkSize, source)); if (ferror(source)) { deflateEnd(&strm); @@ -57,7 +57,7 @@ namespace OpenRCT2::Compression strm.next_in = in; do { - strm.avail_out = CHUNK; + strm.avail_out = kChunkSize; strm.next_out = out; ret = deflate(&strm, flush); if (ret == Z_STREAM_ERROR) @@ -65,7 +65,7 @@ namespace OpenRCT2::Compression LOG_ERROR("Failed to compress data"); return false; } - have = CHUNK - strm.avail_out; + have = kChunkSize - strm.avail_out; if (fwrite(out, 1, have, dest) != have || ferror(dest)) { deflateEnd(&strm); @@ -101,7 +101,7 @@ namespace OpenRCT2::Compression size_t srcRemaining = dataLen; do { - const auto nextBlockSize = std::min(srcRemaining, CHUNK); + const auto nextBlockSize = std::min(srcRemaining, kChunkSize); srcRemaining -= nextBlockSize; flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; @@ -149,7 +149,7 @@ namespace OpenRCT2::Compression size_t srcRemaining = dataLen; do { - const auto nextBlockSize = std::min(srcRemaining, CHUNK); + const auto nextBlockSize = std::min(srcRemaining, kChunkSize); srcRemaining -= nextBlockSize; flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; diff --git a/src/openrct2/core/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp index d771a53d649e..9add20257ab1 100644 --- a/src/openrct2/core/Crypt.OpenRCT2.cpp +++ b/src/openrct2/core/Crypt.OpenRCT2.cpp @@ -19,10 +19,10 @@ using namespace OpenRCT2::Crypt; class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm { private: - static constexpr uint64_t Offset = 0xCBF29CE484222325ULL; - static constexpr uint64_t Prime = 0x00000100000001B3ULL; + static constexpr uint64_t kOffset = 0xCBF29CE484222325ULL; + static constexpr uint64_t kPrime = 0x00000100000001B3ULL; - uint64_t _data = Offset; + uint64_t _data = kOffset; uint8_t _rem[8]{}; size_t _remLen{}; @@ -33,7 +33,7 @@ class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm uint64_t temp{}; std::memcpy(&temp, _rem, _remLen); _data ^= temp; - _data *= Prime; + _data *= kPrime; _remLen = 0; } } @@ -41,7 +41,7 @@ class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm public: HashAlgorithm* Clear() override { - _data = Offset; + _data = kOffset; return this; } @@ -68,7 +68,7 @@ class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm { auto temp = *src++; _data ^= temp; - _data *= Prime; + _data *= kPrime; dataLen -= sizeof(uint64_t); } diff --git a/src/openrct2/core/DateTime.h b/src/openrct2/core/DateTime.h index e340c5770811..95132e23a3cd 100644 --- a/src/openrct2/core/DateTime.h +++ b/src/openrct2/core/DateTime.h @@ -18,4 +18,4 @@ // Time (represented as number of 100-nanosecond intervals since 0001-01-01T00:00:00Z) using datetime64 = uint64_t; -constexpr datetime64 DATETIME64_MIN = 0; +constexpr datetime64 kDatetime64Min = 0; diff --git a/src/openrct2/core/EnumMap.hpp b/src/openrct2/core/EnumMap.hpp index abaa7a887e74..7aeccf0fb588 100644 --- a/src/openrct2/core/EnumMap.hpp +++ b/src/openrct2/core/EnumMap.hpp @@ -25,8 +25,8 @@ class EnumMap std::vector> _map; bool _continiousValueIndex{ false }; - static constexpr size_t BucketSize = 43; - std::array, BucketSize> _buckets; + static constexpr size_t kBucketSize = 43; + std::array, kBucketSize> _buckets; static constexpr bool ValueIndexable() { @@ -84,7 +84,7 @@ class EnumMap for (auto& kv : _map) { auto hash = MakeHash(kv.first); - auto bucketIndex = hash % BucketSize; + auto bucketIndex = hash % kBucketSize; auto& bucket = _buckets[bucketIndex]; bucket.push_back(index); index++; @@ -116,7 +116,7 @@ class EnumMap auto find(const std::string_view k) const { const auto hash = MakeHash(k); - const auto bucketIndex = hash % BucketSize; + const auto bucketIndex = hash % kBucketSize; const auto& bucket = _buckets[bucketIndex]; for (auto index : bucket) diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 5541453ea09a..8113f4ec0bf7 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -62,7 +62,7 @@ class FileIndex }; // Index file format version which when incremented forces a rebuild - static constexpr uint8_t FILE_INDEX_VERSION = 4; + static constexpr uint8_t kFileIndexVersion = 4; std::string const _name; uint32_t const _magicNumber; @@ -224,7 +224,7 @@ class FileIndex // Read header, check if we need to re-scan auto header = fs.ReadValue(); if (header.HeaderSize == sizeof(FileIndexHeader) && header.MagicNumber == _magicNumber - && header.VersionA == FILE_INDEX_VERSION && header.VersionB == _version && header.LanguageId == language + && header.VersionA == kFileIndexVersion && header.VersionB == _version && header.LanguageId == language && header.Stats.TotalFiles == stats.TotalFiles && header.Stats.TotalFileSize == stats.TotalFileSize && header.Stats.FileDateModifiedChecksum == stats.FileDateModifiedChecksum && header.Stats.PathChecksum == stats.PathChecksum) @@ -265,7 +265,7 @@ class FileIndex // Write header FileIndexHeader header; header.MagicNumber = _magicNumber; - header.VersionA = FILE_INDEX_VERSION; + header.VersionA = kFileIndexVersion; header.VersionB = _version; header.LanguageId = language; header.Stats = stats; diff --git a/src/openrct2/core/Guard.cpp b/src/openrct2/core/Guard.cpp index 4dbab00e9efb..e602dc8d75f4 100644 --- a/src/openrct2/core/Guard.cpp +++ b/src/openrct2/core/Guard.cpp @@ -26,7 +26,7 @@ namespace OpenRCT2::Guard { - constexpr const utf8* ASSERTION_MESSAGE = "An assertion failed, please report this to the OpenRCT2 developers."; + static constexpr const utf8* kAssertionMessage = "An assertion failed, please report this to the OpenRCT2 developers."; // The default behaviour when an assertion is raised. static ASSERT_BEHAVIOUR _assertBehaviour = @@ -67,7 +67,7 @@ namespace OpenRCT2::Guard if (expression) return; - Console::Error::WriteLine(ASSERTION_MESSAGE); + Console::Error::WriteLine(kAssertionMessage); Console::Error::WriteLine("Version: %s", gVersionInfoFull); // This is never freed, but acceptable considering we are about to crash out @@ -130,7 +130,7 @@ namespace OpenRCT2::Guard [[nodiscard]] static std::wstring CreateDialogAssertMessage(std::string_view formattedMessage) { StringBuilder sb; - sb.Append(ASSERTION_MESSAGE); + sb.Append(kAssertionMessage); sb.Append("\n\n"); sb.Append("Version: "); sb.Append(gVersionInfoFull); diff --git a/src/openrct2/core/Http.Android.cpp b/src/openrct2/core/Http.Android.cpp index 9978bbca5e77..08a1010a9f53 100644 --- a/src/openrct2/core/Http.Android.cpp +++ b/src/openrct2/core/Http.Android.cpp @@ -18,14 +18,14 @@ #include #include - #define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION + #define kOpenRCT2UserAgent "OpenRCT2/" kOpenRCT2Version namespace OpenRCT2::Http { Response Do(const Request& req) { std::map headers = req.header; - headers["User-Agent"] = OPENRCT2_USER_AGENT; + headers["User-Agent"] = kOpenRCT2UserAgent; // Lambda to convert jstring to string auto jstringToString = [](JNIEnv* env, jstring jstr) -> std::string { if (jstr == nullptr) diff --git a/src/openrct2/core/Http.WinHttp.cpp b/src/openrct2/core/Http.WinHttp.cpp index 1219ba03dc50..a18cc5a733ea 100644 --- a/src/openrct2/core/Http.WinHttp.cpp +++ b/src/openrct2/core/Http.WinHttp.cpp @@ -22,7 +22,7 @@ namespace OpenRCT2::Http { - static constexpr char OPENRCT2_USER_AGENT[] = "OpenRCT2/" OPENRCT2_VERSION; + static constexpr char kOpenRCT2UserAgent[] = "OpenRCT2/" kOpenRCT2Version; static void ThrowWin32Exception(const char* methodName) { @@ -75,10 +75,10 @@ namespace OpenRCT2::Http std::map headers; std::wstring wKey, wValue; - constexpr int32_t STATE_EXPECT_KEY = 0; - constexpr int32_t STATE_EXPECT_WHITESPACE_VALUE = 1; - constexpr int32_t STATE_EXPECT_VALUE = 2; - int32_t state = STATE_EXPECT_KEY; + constexpr int32_t kStateExpectKey = 0; + constexpr int32_t kStateExpectWhitespaceValue = 1; + constexpr int32_t kStateExpectValue = 2; + int32_t state = kStateExpectKey; int32_t index = 0; for (auto c : buffer) { @@ -95,24 +95,24 @@ namespace OpenRCT2::Http wKey.clear(); wValue.clear(); index++; - state = STATE_EXPECT_KEY; + state = kStateExpectKey; continue; } - if (state == STATE_EXPECT_KEY && c == ':') + if (state == kStateExpectKey && c == ':') { - state = STATE_EXPECT_WHITESPACE_VALUE; + state = kStateExpectWhitespaceValue; } else if (state == 1 && c == ' ') { - state = STATE_EXPECT_VALUE; + state = kStateExpectValue; } - else if (state == STATE_EXPECT_KEY) + else if (state == kStateExpectKey) { wKey.push_back(c); } else { - state = STATE_EXPECT_VALUE; + state = kStateExpectValue; wValue.push_back(c); } } @@ -166,7 +166,7 @@ namespace OpenRCT2::Http if (!WinHttpCrackUrl(wUrl.c_str(), 0, 0, &url)) throw std::invalid_argument("Unable to parse URI."); - auto userAgent = String::toWideChar(OPENRCT2_USER_AGENT); + auto userAgent = String::toWideChar(kOpenRCT2UserAgent); hSession = WinHttpOpen( userAgent.c_str(), WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); if (hSession == nullptr) diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index c1c953a6146a..447a5ed0b64f 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -25,7 +25,7 @@ #endif #include - #define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION + #define kOpenRCT2UserAgent "OpenRCT2/" kOpenRCT2Version namespace OpenRCT2::Http { @@ -120,7 +120,7 @@ namespace OpenRCT2::Http curl_easy_setopt(curl, CURLOPT_HEADERDATA, static_cast(&res)); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true); - curl_easy_setopt(curl, CURLOPT_USERAGENT, OPENRCT2_USER_AGENT); + curl_easy_setopt(curl, CURLOPT_USERAGENT, kOpenRCT2UserAgent); curl_slist* chunk = nullptr; std::shared_ptr __(nullptr, [chunk](...) { curl_slist_free_all(chunk); }); diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index 184c48ef88c4..a1dfc7857b1d 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -28,7 +28,7 @@ namespace OpenRCT2::Imaging { - constexpr auto EXCEPTION_IMAGE_FORMAT_UNKNOWN = "Unknown image format."; + static constexpr auto kExceptionImageFormatUnknown = "Unknown image format."; static std::unordered_map _readerImplementations; @@ -300,7 +300,7 @@ namespace OpenRCT2::Imaging { return impl(istream, format); } - throw std::runtime_error(EXCEPTION_IMAGE_FORMAT_UNKNOWN); + throw std::runtime_error(kExceptionImageFormatUnknown); } } } @@ -339,7 +339,7 @@ namespace OpenRCT2::Imaging break; } default: - throw std::runtime_error(EXCEPTION_IMAGE_FORMAT_UNKNOWN); + throw std::runtime_error(kExceptionImageFormatUnknown); } } } // namespace OpenRCT2::Imaging diff --git a/src/openrct2/core/Json.hpp b/src/openrct2/core/Json.hpp index bb24c37df661..d9039752e51d 100644 --- a/src/openrct2/core/Json.hpp +++ b/src/openrct2/core/Json.hpp @@ -24,7 +24,7 @@ using json_t = nlohmann::json; namespace OpenRCT2::Json { // Don't try to load JSON files that exceed 64 MiB - constexpr uint64_t MAX_JSON_SIZE = 64 * 1024 * 1024; + constexpr uint64_t kMaxJSONSize = 64 * 1024 * 1024; /** * Read JSON file and parse contents @@ -33,7 +33,7 @@ namespace OpenRCT2::Json * @return A JSON representation of the file * @note This function will throw an exception if the JSON file cannot be parsed */ - json_t ReadFromFile(u8string_view path, size_t maxSize = MAX_JSON_SIZE); + json_t ReadFromFile(u8string_view path, size_t maxSize = kMaxJSONSize); /** * Read JSON file and parse the contents diff --git a/src/openrct2/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp index d59cdb53cc1d..a6e681f48075 100644 --- a/src/openrct2/core/OrcaStream.hpp +++ b/src/openrct2/core/OrcaStream.hpp @@ -36,8 +36,11 @@ namespace OpenRCT2 WRITING, }; - static constexpr uint32_t COMPRESSION_NONE = 0; - static constexpr uint32_t COMPRESSION_GZIP = 1; + enum class CompressionType : uint32_t + { + none, + gzip, + }; private: #pragma pack(push, 1) @@ -48,7 +51,7 @@ namespace OpenRCT2 uint32_t MinVersion{}; uint32_t NumChunks{}; uint64_t UncompressedSize{}; - uint32_t Compression{}; + CompressionType Compression{}; uint64_t CompressedSize{}; std::array FNV1a{}; uint8_t padding[20]; @@ -99,7 +102,7 @@ namespace OpenRCT2 } while (bytesLeft > 0); // Uncompress - if (_header.Compression == COMPRESSION_GZIP) + if (_header.Compression == CompressionType::gzip) { auto uncompressedData = Compression::ungzip(_buffer.GetData(), _buffer.GetLength()); if (_header.UncompressedSize != uncompressedData.size()) @@ -113,7 +116,7 @@ namespace OpenRCT2 else { _header = {}; - _header.Compression = COMPRESSION_GZIP; + _header.Compression = CompressionType::gzip; _buffer = MemoryStream{}; } @@ -135,7 +138,7 @@ namespace OpenRCT2 // Compress data std::optional> compressedBytes; - if (_header.Compression == COMPRESSION_GZIP) + if (_header.Compression == CompressionType::gzip) { compressedBytes = Compression::gzip(uncompressedData, uncompressedSize); if (compressedBytes) @@ -145,7 +148,7 @@ namespace OpenRCT2 else { // Compression failed - _header.Compression = COMPRESSION_NONE; + _header.Compression = CompressionType::none; } } diff --git a/src/openrct2/core/RTL.FriBidi.cpp b/src/openrct2/core/RTL.FriBidi.cpp index da98bb1a53e8..b428716eab07 100644 --- a/src/openrct2/core/RTL.FriBidi.cpp +++ b/src/openrct2/core/RTL.FriBidi.cpp @@ -21,11 +21,11 @@ extern "C" { #include } -static constexpr uint16_t BufferLength = 1024; +static constexpr uint16_t kBufferLength = 1024; std::string FixRTL(std::string& input) { - FriBidiChar utf32String[BufferLength] = { 0 }; + FriBidiChar utf32String[kBufferLength] = { 0 }; auto len = static_cast(input.length() + 1); fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, input.c_str(), len, utf32String); @@ -38,13 +38,13 @@ std::string FixRTL(std::string& input) } } - FriBidiChar reorderedStr[BufferLength] = { 0 }; + FriBidiChar reorderedStr[kBufferLength] = { 0 }; // All our strings start in LTR direction due to the "STR_0001: prefix", even fully Arabic ones. FriBidiCharType pbase_dir = FRIBIDI_TYPE_LTR; fribidi_log2vis(utf32String, utf32len, &pbase_dir, reorderedStr, nullptr, nullptr, nullptr); - char outputString[BufferLength]; + char outputString[kBufferLength]; fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, reorderedStr, len, outputString); return std::string(outputString); diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index 7ccf2f27e0da..03b5ddb95517 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -34,11 +34,11 @@ namespace OpenRCT2::Random using result_type = uint32_t; static constexpr size_t N = TNum; - static constexpr result_type default_seed = 0x1234567F; + static constexpr result_type kDefaultSeed = 0x1234567F; explicit FixedSeedSequence() { - std::fill(v.begin(), v.end(), default_seed); + std::fill(v.begin(), v.end(), kDefaultSeed); } template< @@ -110,7 +110,7 @@ namespace OpenRCT2::Random static constexpr result_type x = TX; static constexpr size_t r1 = TR1; static constexpr size_t r2 = TR2; - static constexpr result_type default_seed = 1; + static constexpr result_type kDefaultSeed = 1; static constexpr result_type min() { @@ -141,7 +141,7 @@ namespace OpenRCT2::Random seed(seed_seq); } - void seed(result_type s = default_seed) + void seed(result_type s = kDefaultSeed) { s0 = s; s1 = s; diff --git a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp index c11544a3a634..0075ad7d5432 100644 --- a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp @@ -90,28 +90,28 @@ void FASTCALL GfxBmpSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& arg if (imageId.IsBlended()) { // Copy non-transparent bitmap data but blend src and dst pixel using the palette map. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else { // Copy non-transparent bitmap data but re-colour using the palette map. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } } else if (imageId.IsBlended()) { // Image is only a transparency mask. Just colour the pixels using the palette map. // Used for glass. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else if (!(args.SourceImage.flags & G1_FLAG_HAS_TRANSPARENCY)) { // Copy raw bitmap data to target - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else { // Copy raw bitmap data to target but exclude transparent pixels - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp index b1d175633d6b..edb6ac3285d8 100644 --- a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp @@ -129,7 +129,7 @@ static void FASTCALL DrawRLESpriteMinify(DrawPixelInfo& dpi, const DrawSpriteArg numPixels = std::min(numPixels, width - x); auto dst = dstLineStart + (x >> TZoom); - if constexpr ((TBlendOp & BLEND_SRC) == 0 && (TBlendOp & BLEND_DST) == 0 && TZoom == 0) + if constexpr ((TBlendOp & kBlendSrc) == 0 && (TBlendOp & kBlendDst) == 0 && TZoom == 0) { // Since we're sampling each pixel at this zoom level, just do a straight std::memcpy if (numPixels > 0) @@ -192,19 +192,19 @@ void FASTCALL GfxRleSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& arg { if (args.Image.IsBlended()) { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } } else if (args.Image.IsBlended()) { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 78fac26d2b84..3bb943b897bc 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -435,7 +435,7 @@ static void MaskMagnify( static Gx _g1 = {}; static Gx _g2 = {}; static Gx _csg = {}; -static G1Element _scrollingText[MaxScrollingTextEntries]{}; +static G1Element _scrollingText[kMaxScrollingTextEntries]{}; static bool _csgLoaded = false; static G1Element _g1Temp = {}; @@ -1010,7 +1010,7 @@ const G1Element* GfxGetG1Element(ImageIndex image_id) Guard::Assert(!gOpenRCT2NoGraphics, "GfxGetG1Element called on headless instance"); auto offset = static_cast(image_id); - if (offset == 0x7FFFF || offset == ImageIndexUndefined) + if (offset == kImageIndexUndefined) { return nullptr; } diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 148f3bc88b49..2aa1ee6d3200 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -160,12 +160,12 @@ int32_t GfxClipString(utf8* text, int32_t width, FontStyle fontStyle) */ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8string* outWrappedText, int32_t* outNumLines) { - constexpr size_t NULL_INDEX = std::numeric_limits::max(); + constexpr size_t kNullIndex = std::numeric_limits::max(); u8string buffer; size_t currentLineIndex = 0; - size_t splitIndex = NULL_INDEX; - size_t bestSplitIndex = NULL_INDEX; + size_t splitIndex = kNullIndex; + size_t bestSplitIndex = kNullIndex; size_t numLines = 0; int32_t maxWidth = 0; @@ -182,14 +182,14 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 buffer.append(cb); auto lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle); - if (lineWidth <= width || (splitIndex == NULL_INDEX && bestSplitIndex == NULL_INDEX)) + if (lineWidth <= width || (splitIndex == kNullIndex && bestSplitIndex == kNullIndex)) { if (codepoint == ' ') { // Mark line split here splitIndex = buffer.size() - 1; } - else if (splitIndex == NULL_INDEX) + else if (splitIndex == kNullIndex) { // Mark line split here (this is after first character of line) bestSplitIndex = buffer.size(); @@ -198,7 +198,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 else { // Insert new line before current word - if (splitIndex == NULL_INDEX) + if (splitIndex == kNullIndex) { splitIndex = bestSplitIndex; } @@ -210,8 +210,8 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 numLines++; currentLineIndex = splitIndex + 1; - splitIndex = NULL_INDEX; - bestSplitIndex = NULL_INDEX; + splitIndex = kNullIndex; + bestSplitIndex = kNullIndex; // Trim the beginning of the new line while (buffer[currentLineIndex] == ' ') @@ -230,8 +230,8 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 numLines++; currentLineIndex = buffer.size(); - splitIndex = NULL_INDEX; - bestSplitIndex = NULL_INDEX; + splitIndex = kNullIndex; + bestSplitIndex = kNullIndex; } else { diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 78d9f4c510bb..ccefd11f8500 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -286,7 +286,7 @@ enum SPR_PALETTE_GLASS_VOID, }; -static constexpr FilterPaletteID GlassPaletteIds[COLOUR_COUNT] = { +static constexpr FilterPaletteID kGlassPaletteIds[COLOUR_COUNT] = { FilterPaletteID::PaletteGlassBlack, FilterPaletteID::PaletteGlassGrey, FilterPaletteID::PaletteGlassWhite, @@ -347,7 +347,7 @@ static constexpr FilterPaletteID GlassPaletteIds[COLOUR_COUNT] = { // Previously 0x97FCBC use it to get the correct palette from g1_elements // clang-format off -static constexpr uint16_t palette_to_g1_offset[kPaletteTotalOffsets] = { +static constexpr uint16_t kPaletteToG1Offset[kPaletteTotalOffsets] = { SPR_PALETTE_BLACK, SPR_PALETTE_GREY, SPR_PALETTE_WHITE, @@ -728,7 +728,7 @@ void LoadPalette() auto water_type = OpenRCT2::ObjectManager::GetObjectEntry(0); if (water_type != nullptr) { - Guard::Assert(water_type->image_id != ImageIndexUndefined, "Failed to load water palette"); + Guard::Assert(water_type->image_id != kImageIndexUndefined, "Failed to load water palette"); palette = water_type->image_id; } @@ -849,7 +849,7 @@ std::optional GetPaletteG1Index(colour_t paletteId) { if (paletteId < kPaletteTotalOffsets) { - return palette_to_g1_offset[paletteId]; + return kPaletteToG1Offset[paletteId]; } return std::nullopt; } @@ -887,7 +887,7 @@ DrawPixelInfo DrawPixelInfo::Crop(const ScreenCoordsXY& pos, const ScreenSize& s FilterPaletteID GetGlassPaletteId(colour_t c) { - return GlassPaletteIds[c]; + return kGlassPaletteIds[c]; } void UpdatePalette(std::span palette, int32_t start_index, int32_t num_colours) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 0d01df3923da..d91fcc1e292b 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -159,25 +159,25 @@ enum using DrawBlendOp = uint8_t; -constexpr DrawBlendOp BLEND_NONE = 0; +constexpr DrawBlendOp kBlendNone = 0; /** * Only supported by BITMAP. RLE images always encode transparency via the encoding. * Pixel value of 0 represents transparent. */ -constexpr DrawBlendOp BLEND_TRANSPARENT = 1 << 0; +constexpr DrawBlendOp kBlendTransparent = 1 << 0; /** * Whether to use the pixel value from the source image. * This is usually only unset for glass images where there the src is only a transparency mask. */ -constexpr DrawBlendOp BLEND_SRC = 1 << 1; +constexpr DrawBlendOp kBlendSrc = 1 << 1; /** * Whether to use the pixel value of the destination image for blending. * This is used for any image that filters the target image, e.g. glass or water. */ -constexpr DrawBlendOp BLEND_DST = 2 << 2; +constexpr DrawBlendOp kBlendDst = 2 << 2; enum { @@ -417,7 +417,7 @@ struct DrawSpriteArgs template bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& paletteMap) { - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { // Ignore transparent pixels if (*src == 0) @@ -426,10 +426,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale } } - if constexpr (((TBlendOp & BLEND_SRC) != 0) && ((TBlendOp & BLEND_DST) != 0)) + if constexpr (((TBlendOp & kBlendSrc) != 0) && ((TBlendOp & kBlendDst) != 0)) { auto pixel = paletteMap.Blend(*src, *dst); - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { @@ -439,10 +439,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale *dst = pixel; return true; } - else if constexpr ((TBlendOp & BLEND_SRC) != 0) + else if constexpr ((TBlendOp & kBlendSrc) != 0) { auto pixel = paletteMap[*src]; - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { @@ -452,10 +452,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale *dst = pixel; return true; } - else if constexpr ((TBlendOp & BLEND_DST) != 0) + else if constexpr ((TBlendOp & kBlendDst) != 0) { auto pixel = paletteMap[*dst]; - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index da24d5e1d3dc..5d73486da2ec 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -25,13 +25,13 @@ using namespace OpenRCT2; -static constexpr int32_t SpriteFontLineHeight[FontStyleCount] = { +static constexpr int32_t kSpriteFontLineHeight[FontStyleCount] = { 10, 10, 6, }; -static uint8_t _spriteFontCharacterWidths[FontStyleCount][FONT_SPRITE_GLYPH_COUNT]; +static uint8_t _spriteFontCharacterWidths[FontStyleCount][kSpriteFontGlyphCount]; static uint8_t _additionalSpriteFontCharacterWidth[FontStyleCount][SPR_G2_GLYPH_COUNT] = {}; #ifndef NO_TTF @@ -269,8 +269,8 @@ void FontSpriteInitialiseCharacters() for (const auto& fontStyle : FontStyles) { - int32_t glyphOffset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; - for (uint8_t glyphIndex = 0; glyphIndex < FONT_SPRITE_GLYPH_COUNT; glyphIndex++) + int32_t glyphOffset = EnumValue(fontStyle) * kSpriteFontGlyphCount; + for (uint8_t glyphIndex = 0; glyphIndex < kSpriteFontGlyphCount; glyphIndex++) { const G1Element* g1 = GfxGetG1Element(glyphIndex + SPR_CHAR_START + glyphOffset); int32_t width = 0; @@ -323,7 +323,7 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) { int32_t glyphIndex = FontSpriteGetCodepointOffset(codepoint); auto baseFontIndex = EnumValue(fontStyle); - if (glyphIndex >= FONT_SPRITE_GLYPH_COUNT) + if (glyphIndex >= kSpriteFontGlyphCount) { glyphIndex = (SPR_CHAR_START + glyphIndex) - SPR_G2_CHAR_BEGIN; @@ -335,7 +335,7 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) return _additionalSpriteFontCharacterWidth[baseFontIndex][glyphIndex]; } - if (glyphIndex < 0 || glyphIndex >= static_cast(FONT_SPRITE_GLYPH_COUNT)) + if (glyphIndex < 0 || glyphIndex >= static_cast(kSpriteFontGlyphCount)) { LOG_WARNING("Invalid glyph index %u", glyphIndex); glyphIndex = 0; @@ -345,9 +345,9 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) ImageId FontSpriteGetCodepointSprite(FontStyle fontStyle, int32_t codepoint) { - int32_t offset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; + int32_t offset = EnumValue(fontStyle) * kSpriteFontGlyphCount; auto codePointOffset = FontSpriteGetCodepointOffset(codepoint); - if (codePointOffset > FONT_SPRITE_GLYPH_COUNT) + if (codePointOffset > kSpriteFontGlyphCount) { offset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT; } @@ -364,7 +364,7 @@ int32_t FontGetLineHeight(FontStyle fontStyle) return gCurrentTTFFontSet->size[fontSize].line_height; } #endif // NO_TTF - return SpriteFontLineHeight[fontSize]; + return kSpriteFontLineHeight[fontSize]; } int32_t FontGetLineHeightSmall(FontStyle fontStyle) diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index df0d7c2402b0..5dca83bdd006 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -14,7 +14,7 @@ #include -constexpr uint16_t FONT_SPRITE_GLYPH_COUNT = 224; +constexpr uint16_t kSpriteFontGlyphCount = 224; enum class FontStyle : uint8_t { diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index 1ac088264e6e..cbf98553a624 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -21,8 +21,8 @@ using namespace OpenRCT2; -constexpr uint32_t BASE_IMAGE_ID = SPR_IMAGE_LIST_BEGIN; -constexpr uint32_t MAX_IMAGES = SPR_IMAGE_LIST_END - BASE_IMAGE_ID; +constexpr uint32_t kBaseImageID = SPR_IMAGE_LIST_BEGIN; +constexpr uint32_t kMaxImages = SPR_IMAGE_LIST_END - kBaseImageID; static bool _initialised = false; static std::list _freeLists; @@ -65,7 +65,7 @@ static bool AllocatedListRemove(uint32_t baseImageId, uint32_t count) static uint32_t GetNumFreeImagesRemaining() { - return MAX_IMAGES - _allocatedImageCount; + return kMaxImages - _allocatedImageCount; } static void InitialiseImageList() @@ -73,7 +73,7 @@ static void InitialiseImageList() Guard::Assert(!_initialised, GUARD_LINE); _freeLists.clear(); - _freeLists.push_back({ BASE_IMAGE_ID, MAX_IMAGES }); + _freeLists.push_back({ kBaseImageID, kMaxImages }); #ifdef DEBUG_LEVEL_1 _allocatedLists.clear(); #endif @@ -129,7 +129,7 @@ static uint32_t TryAllocateImageList(uint32_t count) return imageList.BaseId; } } - return ImageIndexUndefined; + return kImageIndexUndefined; } static uint32_t AllocateImageList(uint32_t count) @@ -141,12 +141,12 @@ static uint32_t AllocateImageList(uint32_t count) InitialiseImageList(); } - uint32_t baseImageId = ImageIndexUndefined; + uint32_t baseImageId = kImageIndexUndefined; uint32_t freeImagesRemaining = GetNumFreeImagesRemaining(); if (freeImagesRemaining >= count) { baseImageId = TryAllocateImageList(count); - if (baseImageId == ImageIndexUndefined) + if (baseImageId == kImageIndexUndefined) { // Defragment and try again MergeFreeLists(); @@ -159,7 +159,7 @@ static uint32_t AllocateImageList(uint32_t count) static void FreeImageList(uint32_t baseImageId, uint32_t count) { Guard::Assert(_initialised, GUARD_LINE); - Guard::Assert(baseImageId >= BASE_IMAGE_ID, GUARD_LINE); + Guard::Assert(baseImageId >= kBaseImageID, GUARD_LINE); #ifdef DEBUG_LEVEL_1 if (!AllocatedListRemove(baseImageId, count)) @@ -192,14 +192,14 @@ uint32_t GfxObjectAllocateImages(const G1Element* images, uint32_t count) { if (count == 0 || gOpenRCT2NoGraphics) { - return ImageIndexUndefined; + return kImageIndexUndefined; } uint32_t baseImageId = AllocateImageList(count); - if (baseImageId == ImageIndexUndefined) + if (baseImageId == kImageIndexUndefined) { LOG_ERROR("Reached maximum image limit."); - return ImageIndexUndefined; + return kImageIndexUndefined; } uint32_t imageId = baseImageId; @@ -215,7 +215,7 @@ uint32_t GfxObjectAllocateImages(const G1Element* images, uint32_t count) void GfxObjectFreeImages(uint32_t baseImageId, uint32_t count) { - if (baseImageId != 0 && baseImageId != ImageIndexUndefined) + if (baseImageId != 0 && baseImageId != kImageIndexUndefined) { // Zero the G1 elements so we don't have invalid pointers // and data lying about @@ -250,7 +250,7 @@ size_t ImageListGetUsedCount() size_t ImageListGetMaximum() { - return MAX_IMAGES; + return kMaxImages; } const std::list& GetAvailableAllocationRanges() diff --git a/src/openrct2/drawing/ImageId.hpp b/src/openrct2/drawing/ImageId.hpp index 476beb6c78c1..8a0cdaaa45ac 100644 --- a/src/openrct2/drawing/ImageId.hpp +++ b/src/openrct2/drawing/ImageId.hpp @@ -18,7 +18,7 @@ using colour_t = uint8_t; enum class FilterPaletteID : int32_t; -static constexpr ImageIndex ImageIndexUndefined = std::numeric_limits::max(); +static constexpr ImageIndex kImageIndexUndefined = std::numeric_limits::max(); enum class ImageCatalogue { @@ -42,24 +42,9 @@ FilterPaletteID GetGlassPaletteId(colour_t); struct ImageId { private: - // clang-format off - static constexpr uint32_t MASK_INDEX = 0b00000000000001111111111111111111; - static constexpr uint32_t MASK_REMAP = 0b00000111111110000000000000000000; - static constexpr uint32_t MASK_PRIMARY = 0b00000000111110000000000000000000; - static constexpr uint32_t MASK_SECONDARY = 0b00011111000000000000000000000000; - static constexpr uint32_t FLAG_PRIMARY = 0b00100000000000000000000000000000; - static constexpr uint32_t FLAG_BLEND = 0b01000000000000000000000000000000; - static constexpr uint32_t FLAG_SECONDARY = 0b10000000000000000000000000000000; - static constexpr uint32_t SHIFT_REMAP = 19; - static constexpr uint32_t SHIFT_PRIMARY = 19; - static constexpr uint32_t SHIFT_SECONDARY = 24; - static constexpr uint32_t INDEX_UNDEFINED = 0b00000000000001111111111111111111; - static constexpr uint32_t VALUE_UNDEFINED = INDEX_UNDEFINED; - - static constexpr uint8_t NEW_FLAG_PRIMARY = 1; - static constexpr uint8_t NEW_FLAG_BLEND = 2; - static constexpr uint8_t NEW_FLAG_SECONDARY = 4; - // clang-format on + static constexpr uint8_t kFlagPrimary = 1; + static constexpr uint8_t kFlagBlend = 2; + static constexpr uint8_t kFlagSecondary = 4; // NONE = No remap // BLENDED = No source copy, remap destination only (glass) @@ -68,7 +53,7 @@ struct ImageId // PRIMARY | SECONDARY = Remap with primary and secondary colours // SECONDARY = Remap with primary, secondary and tertiary colours - ImageIndex _index = ImageIndexUndefined; + ImageIndex _index = kImageIndexUndefined; uint8_t _primary = 0; uint8_t _secondary = 0; uint8_t _tertiary = 0; @@ -78,7 +63,7 @@ struct ImageId ImageId() = default; explicit constexpr ImageId(ImageIndex index) - : _index(index == INDEX_UNDEFINED ? ImageIndexUndefined : index) + : _index(index) { } @@ -104,32 +89,32 @@ struct ImageId bool HasValue() const { - return GetIndex() != ImageIndexUndefined; + return GetIndex() != kImageIndexUndefined; } bool HasPrimary() const { - return (_flags & NEW_FLAG_PRIMARY) || (_flags & NEW_FLAG_SECONDARY); + return (_flags & kFlagPrimary) || (_flags & kFlagSecondary); } bool HasSecondary() const { - return _flags & NEW_FLAG_SECONDARY; + return _flags & kFlagSecondary; } bool HasTertiary() const { - return !(_flags & NEW_FLAG_PRIMARY) && (_flags & NEW_FLAG_SECONDARY); + return !(_flags & kFlagPrimary) && (_flags & kFlagSecondary); } bool IsRemap() const { - return (_flags & NEW_FLAG_PRIMARY) && !(_flags & NEW_FLAG_SECONDARY); + return (_flags & kFlagPrimary) && !(_flags & kFlagSecondary); } bool IsBlended() const { - return _flags & NEW_FLAG_BLEND; + return _flags & kFlagBlend; } ImageIndex GetIndex() const @@ -184,8 +169,8 @@ struct ImageId result._primary = paletteId; result._secondary = 0; result._tertiary = 0; - result._flags |= NEW_FLAG_PRIMARY; - result._flags &= ~NEW_FLAG_SECONDARY; + result._flags |= kFlagPrimary; + result._flags &= ~kFlagSecondary; return result; } @@ -193,7 +178,7 @@ struct ImageId { ImageId result = *this; result._primary = colour; - result._flags |= NEW_FLAG_PRIMARY; + result._flags |= kFlagPrimary; return result; } @@ -201,7 +186,7 @@ struct ImageId { ImageId result = *this; result._secondary = colour; - result._flags |= NEW_FLAG_SECONDARY; + result._flags |= kFlagSecondary; return result; } @@ -209,7 +194,7 @@ struct ImageId { ImageId result = *this; result._secondary = 0; - result._flags &= ~NEW_FLAG_SECONDARY; + result._flags &= ~kFlagSecondary; return result; } @@ -217,9 +202,9 @@ struct ImageId { ImageId result = *this; result._tertiary = tertiary; - result._flags &= ~NEW_FLAG_PRIMARY; - result._flags |= NEW_FLAG_SECONDARY; - if (!(_flags & NEW_FLAG_SECONDARY)) + result._flags &= ~kFlagPrimary; + result._flags |= kFlagSecondary; + if (!(_flags & kFlagSecondary)) { // Tertiary implies primary and secondary, so if colour was remap (8-bit primary) then // we need to zero the secondary colour. @@ -239,7 +224,7 @@ struct ImageId result._primary = static_cast(palette); result._secondary = 0; result._tertiary = 0; - result._flags = NEW_FLAG_BLEND; + result._flags = kFlagBlend; return result; } @@ -247,9 +232,9 @@ struct ImageId { ImageId result = *this; if (value) - result._flags |= NEW_FLAG_BLEND; + result._flags |= kFlagBlend; else - result._flags &= ~NEW_FLAG_BLEND; + result._flags &= ~kFlagBlend; return result; } diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index e8ee12011a93..2814e871d714 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -18,7 +18,7 @@ namespace OpenRCT2::Drawing { - constexpr int32_t PALETTE_TRANSPARENT = -1; + static constexpr int32_t kPaletteTransparent = -1; ImageImporter::ImportResult ImageImporter::Import(const Image& image, ImageImportMeta& meta) const { @@ -101,7 +101,7 @@ namespace OpenRCT2::Drawing // The 1st index is always transparent if (paletteIndex == 0) { - paletteIndex = PALETTE_TRANSPARENT; + paletteIndex = kPaletteTransparent; } palettedSrc += 1; buffer.push_back(paletteIndex); @@ -133,7 +133,7 @@ namespace OpenRCT2::Drawing for (auto i = 0; i < bufferLength; i++) { auto p = pixels[i]; - buffer[i] = (p == PALETTE_TRANSPARENT ? 0 : static_cast(p)); + buffer[i] = (p == kPaletteTransparent ? 0 : static_cast(p)); } return buffer; } @@ -166,7 +166,7 @@ namespace OpenRCT2::Drawing for (auto x = 0; x < size.width; x++) { int32_t paletteIndex = *src++; - if (paletteIndex == PALETTE_TRANSPARENT) + if (paletteIndex == kPaletteTransparent) { if (npixels != 0) { @@ -315,7 +315,7 @@ namespace OpenRCT2::Drawing } } } - return PALETTE_TRANSPARENT; + return kPaletteTransparent; } bool ImageImporter::IsTransparentPixel(const int16_t* colour) @@ -328,7 +328,7 @@ namespace OpenRCT2::Drawing */ bool ImageImporter::IsInPalette(const GamePalette& palette, int16_t* colour) { - return !(GetPaletteIndex(palette, colour) == PALETTE_TRANSPARENT && !IsTransparentPixel(colour)); + return !(GetPaletteIndex(palette, colour) == kPaletteTransparent && !IsTransparentPixel(colour)); } /** @@ -363,7 +363,7 @@ namespace OpenRCT2::Drawing int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour) { auto smallestError = static_cast(-1); - auto bestMatch = PALETTE_TRANSPARENT; + auto bestMatch = kPaletteTransparent; for (uint32_t x = 0; x < kGamePaletteSize; x++) { if (IsChangablePixel(x)) diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index ac39ca0ca037..f86d150d4d45 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -308,7 +308,8 @@ namespace OpenRCT2::Drawing::LightFx PaintSession* session = PaintSessionAlloc(dpi, w->viewport->flags, w->viewport->rotation); PaintSessionGenerate(*session); PaintSessionArrange(*session); - auto info = SetInteractionInfoFromPaintSession(session, w->viewport->flags, ViewportInteractionItemAll); + auto info = SetInteractionInfoFromPaintSession( + session, w->viewport->flags, kViewportInteractionItemAll); PaintSessionFree(session); // LOG_WARNING("[%i, %i]", dpi->x, dpi->y); @@ -693,7 +694,7 @@ namespace OpenRCT2::Drawing::LightFx return _lightPolution_front; } - static constexpr int16_t offsetLookup[] = { + static constexpr int16_t kOffsetLookup[] = { 10, 10, 9, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -9, -10, -10, -10, -9, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 9, 10, }; void AddLightsMagicVehicle_ObservationTower(const Vehicle* vehicle) @@ -708,8 +709,8 @@ namespace OpenRCT2::Drawing::LightFx { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + int16_t place_x = vehicle->x - kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 0, { place_x, place_y, vehicle->z }, LightType::Spot3); } } @@ -728,11 +729,11 @@ namespace OpenRCT2::Drawing::LightFx } int16_t place_x = vehicle_draw->x; int16_t place_y = vehicle_draw->y; - place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; + place_x -= kOffsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= kOffsetLookup[(vehicle_draw->Orientation + 8) % 32]; Add3DLight(*vehicle, 0, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); - place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; + place_x -= kOffsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= kOffsetLookup[(vehicle_draw->Orientation + 8) % 32]; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); } void AddLightsMagicVehicle_Monorail(const Vehicle* vehicle) @@ -742,20 +743,20 @@ namespace OpenRCT2::Drawing::LightFx int16_t place_y = vehicle->y; if (vehicle == vehicle->TrainHead()) { - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 3; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 3; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 3; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 3; Add3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } if (vehicle == vehicle->TrainTail()) { - place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x += kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 3, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x += kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 4, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } } @@ -763,11 +764,11 @@ namespace OpenRCT2::Drawing::LightFx { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + int16_t place_x = vehicle->x - kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } else diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 6e63c9b18bd5..2277e252daab 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -208,7 +208,7 @@ void GfxDrawDashedLine( const auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { - constexpr int32_t precisionFactor = 1000; + constexpr int32_t kPrecisionFactor = 1000; const int32_t dashedLineLength = std::hypot( screenLine.GetX2() - screenLine.GetX1(), screenLine.GetY2() - screenLine.GetY1()); @@ -220,15 +220,15 @@ void GfxDrawDashedLine( const int32_t lineXDist = std::abs(screenLine.GetX2() - screenLine.GetX1()); const int32_t lineYDist = std::abs(screenLine.GetY2() - screenLine.GetY1()); - const int32_t dxPrecise = precisionFactor * lineXDist / lineSegmentCount / 2; - const int32_t dyPrecise = precisionFactor * lineYDist / lineSegmentCount / 2; + const int32_t dxPrecise = kPrecisionFactor * lineXDist / lineSegmentCount / 2; + const int32_t dyPrecise = kPrecisionFactor * lineYDist / lineSegmentCount / 2; IDrawingContext* dc = drawingEngine->GetDrawingContext(); for (int32_t i = 0, x, y; i < lineSegmentCount; ++i) { - x = screenLine.GetX1() + dxPrecise * i * 2 / precisionFactor; - y = screenLine.GetY1() + dyPrecise * i * 2 / precisionFactor; - dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } }); + x = screenLine.GetX1() + dxPrecise * i * 2 / kPrecisionFactor; + y = screenLine.GetY1() + dyPrecise * i * 2 / kPrecisionFactor; + dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / kPrecisionFactor, y + dyPrecise / kPrecisionFactor } }); } } } diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 79c2c742f65e..12b549c38aa5 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -38,8 +38,8 @@ struct DrawScrollText uint8_t bitmap[64 * 40]; }; -static DrawScrollText _drawScrollTextList[OpenRCT2::MaxScrollingTextEntries]; -static uint8_t _characterBitmaps[FONT_SPRITE_GLYPH_COUNT + SPR_G2_GLYPH_COUNT][8]; +static DrawScrollText _drawScrollTextList[OpenRCT2::kMaxScrollingTextEntries]; +static uint8_t _characterBitmaps[kSpriteFontGlyphCount + SPR_G2_GLYPH_COUNT][8]; static uint32_t _drawSCrollNextIndex = 0; static std::mutex _scrollingTextMutex; @@ -80,7 +80,7 @@ static void ScrollingTextInitialiseCharacterBitmaps(uint32_t glyphStart, uint16_ static void ScrollingTextInitialiseScrollingText() { - for (int32_t i = 0; i < OpenRCT2::MaxScrollingTextEntries; i++) + for (int32_t i = 0; i < OpenRCT2::kMaxScrollingTextEntries; i++) { const int32_t imageId = SPR_SCROLLING_TEXT_START + i; @@ -105,17 +105,17 @@ static void ScrollingTextInitialiseScrollingText() void ScrollingTextInitialiseBitmaps() { - ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, FONT_SPRITE_GLYPH_COUNT, gTinyFontAntiAliased); - ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, FONT_SPRITE_GLYPH_COUNT, SPR_G2_GLYPH_COUNT, false); + ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, kSpriteFontGlyphCount, gTinyFontAntiAliased); + ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, kSpriteFontGlyphCount, SPR_G2_GLYPH_COUNT, false); ScrollingTextInitialiseScrollingText(); } static uint8_t* FontSpriteGetCodepointBitmap(int32_t codepoint) { auto offset = FontSpriteGetCodepointOffset(codepoint); - if (offset >= FONT_SPRITE_GLYPH_COUNT) + if (offset >= kSpriteFontGlyphCount) { - return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + FONT_SPRITE_GLYPH_COUNT]; + return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + kSpriteFontGlyphCount]; } return _characterBitmaps[offset]; @@ -167,7 +167,7 @@ consteval int16_t ScrollPos(const int16_t x, const int16_t y) } // clang-format off -static constexpr int16_t _scrollpos0[] = { +static constexpr int16_t kScrollPos0[] = { ScrollPos( 35, 12 ), ScrollPos( 36, 12 ), ScrollPos( 37, 11 ), @@ -194,7 +194,7 @@ static constexpr int16_t _scrollpos0[] = { ScrollPos( 58, 1 ), -1, }; -static constexpr int16_t _scrollpos1[] = { +static constexpr int16_t kScrollPos1[] = { ScrollPos( 5, 1 ), ScrollPos( 6, 1 ), ScrollPos( 7, 2 ), @@ -221,7 +221,7 @@ static constexpr int16_t _scrollpos1[] = { ScrollPos( 28, 12 ), -1, }; -static constexpr int16_t _scrollpos2[] = { +static constexpr int16_t kScrollPos2[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 1 ), ScrollPos( 14, 2 ), @@ -263,7 +263,7 @@ static constexpr int16_t _scrollpos2[] = { ScrollPos( 50, 1 ), -1, }; -static constexpr int16_t _scrollpos3[] = { +static constexpr int16_t kScrollPos3[] = { ScrollPos( 16, 0 ), ScrollPos( 17, 1 ), ScrollPos( 18, 1 ), @@ -299,7 +299,7 @@ static constexpr int16_t _scrollpos3[] = { ScrollPos( 48, 16 ), -1, }; -static constexpr int16_t _scrollpos4[] = { +static constexpr int16_t kScrollPos4[] = { ScrollPos( 15, 17 ), ScrollPos( 16, 17 ), ScrollPos( 17, 16 ), @@ -336,7 +336,7 @@ static constexpr int16_t _scrollpos4[] = { ScrollPos( 48, 0 ), -1, }; -static constexpr int16_t _scrollpos5[] = { +static constexpr int16_t kScrollPos5[] = { ScrollPos( 4, 12 ), ScrollPos( 5, 12 ), ScrollPos( 6, 11 ), @@ -363,7 +363,7 @@ static constexpr int16_t _scrollpos5[] = { ScrollPos( 27, 1 ), -1, }; -static constexpr int16_t _scrollpos6[] = { +static constexpr int16_t kScrollPos6[] = { ScrollPos( 36, 1 ), ScrollPos( 37, 1 ), ScrollPos( 38, 2 ), @@ -390,7 +390,7 @@ static constexpr int16_t _scrollpos6[] = { ScrollPos( 59, 12 ), -1, }; -static constexpr int16_t _scrollpos7[] = { +static constexpr int16_t kScrollPos7[] = { ScrollPos( 8, 11 ), ScrollPos( 9, 11 ), ScrollPos( 10, 10 ), @@ -415,7 +415,7 @@ static constexpr int16_t _scrollpos7[] = { ScrollPos( 29, 1 ), -1, }; -static constexpr int16_t _scrollpos8[] = { +static constexpr int16_t kScrollPos8[] = { ScrollPos( 36, 2 ), ScrollPos( 37, 2 ), ScrollPos( 38, 3 ), @@ -438,7 +438,7 @@ static constexpr int16_t _scrollpos8[] = { ScrollPos( 55, 11 ), -1, }; -static constexpr int16_t _scrollpos9[] = { +static constexpr int16_t kScrollPos9[] = { ScrollPos( 11, 9 ), ScrollPos( 12, 9 ), ScrollPos( 13, 9 ), @@ -460,7 +460,7 @@ static constexpr int16_t _scrollpos9[] = { ScrollPos( 29, 1 ), -1, }; -static constexpr int16_t _scrollpos10[] = { +static constexpr int16_t kScrollPos10[] = { ScrollPos( 34, 1 ), ScrollPos( 35, 2 ), ScrollPos( 36, 3 ), @@ -482,7 +482,7 @@ static constexpr int16_t _scrollpos10[] = { ScrollPos( 52, 9 ), -1, }; -static constexpr int16_t _scrollpos11[] = { +static constexpr int16_t kScrollPos11[] = { ScrollPos( 14, 10 ), ScrollPos( 15, 9 ), ScrollPos( 16, 9 ), @@ -506,7 +506,7 @@ static constexpr int16_t _scrollpos11[] = { ScrollPos( 34, 0 ), -1, }; -static constexpr int16_t _scrollpos12[] = { +static constexpr int16_t kScrollPos12[] = { ScrollPos( 33, 1 ), ScrollPos( 34, 2 ), ScrollPos( 35, 2 ), @@ -530,7 +530,7 @@ static constexpr int16_t _scrollpos12[] = { ScrollPos( 53, 11 ), -1, }; -static constexpr int16_t _scrollpos13[] = { +static constexpr int16_t kScrollPos13[] = { ScrollPos( 12, 11 ), ScrollPos( 13, 10 ), ScrollPos( 14, 10 ), @@ -553,7 +553,7 @@ static constexpr int16_t _scrollpos13[] = { ScrollPos( 31, 1 ), -1, }; -static constexpr int16_t _scrollpos14[] = { +static constexpr int16_t kScrollPos14[] = { ScrollPos( 33, 1 ), ScrollPos( 34, 2 ), ScrollPos( 35, 2 ), @@ -577,7 +577,7 @@ static constexpr int16_t _scrollpos14[] = { ScrollPos( 53, 11 ), -1, }; -static constexpr int16_t _scrollpos15[] = { +static constexpr int16_t kScrollPos15[] = { ScrollPos( 10, 10 ), ScrollPos( 11, 10 ), ScrollPos( 12, 9 ), @@ -602,7 +602,7 @@ static constexpr int16_t _scrollpos15[] = { ScrollPos( 31, 0 ), -1, }; -static constexpr int16_t _scrollpos16[] = { +static constexpr int16_t kScrollPos16[] = { ScrollPos( 33, 0 ), ScrollPos( 34, 0 ), ScrollPos( 35, 1 ), @@ -627,7 +627,7 @@ static constexpr int16_t _scrollpos16[] = { ScrollPos( 54, 10 ), -1, }; -static constexpr int16_t _scrollpos17[] = { +static constexpr int16_t kScrollPos17[] = { ScrollPos( 6, 11 ), ScrollPos( 7, 11 ), ScrollPos( 8, 10 ), @@ -654,7 +654,7 @@ static constexpr int16_t _scrollpos17[] = { ScrollPos( 29, 0 ), -1, }; -static constexpr int16_t _scrollpos18[] = { +static constexpr int16_t kScrollPos18[] = { ScrollPos( 34, 0 ), ScrollPos( 35, 0 ), ScrollPos( 36, 1 ), @@ -681,7 +681,7 @@ static constexpr int16_t _scrollpos18[] = { ScrollPos( 57, 11 ), -1, }; -static constexpr int16_t _scrollpos19[] = { +static constexpr int16_t kScrollPos19[] = { ScrollPos( 13, 1 ), ScrollPos( 14, 1 ), ScrollPos( 15, 2 ), @@ -723,7 +723,7 @@ static constexpr int16_t _scrollpos19[] = { ScrollPos( 51, 1 ), -1, }; -static constexpr int16_t _scrollpos20[] = { +static constexpr int16_t kScrollPos20[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 3 ), ScrollPos( 14, 4 ), @@ -764,7 +764,7 @@ static constexpr int16_t _scrollpos20[] = { ScrollPos( 49, 3 ), -1, }; -static constexpr int16_t _scrollpos21[] = { +static constexpr int16_t kScrollPos21[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 1 ), ScrollPos( 14, 2 ), @@ -805,7 +805,7 @@ static constexpr int16_t _scrollpos21[] = { ScrollPos( 49, 1 ), -1, }; -static constexpr int16_t _scrollpos22[] = { +static constexpr int16_t kScrollPos22[] = { ScrollPos( 16, 1 ), ScrollPos( 17, 1 ), ScrollPos( 18, 2 ), @@ -841,7 +841,7 @@ static constexpr int16_t _scrollpos22[] = { ScrollPos( 48, 1 ), -1, }; -static constexpr int16_t _scrollpos23[] = { +static constexpr int16_t kScrollPos23[] = { ScrollPos( 15, 1 ), ScrollPos( 16, 2 ), ScrollPos( 17, 2 ), @@ -878,7 +878,7 @@ static constexpr int16_t _scrollpos23[] = { ScrollPos( 48, 1 ), -1, }; -static constexpr int16_t _scrollpos24[] = { +static constexpr int16_t kScrollPos24[] = { ScrollPos( 8, 9 ), ScrollPos( 9, 9 ), ScrollPos( 10, 8 ), @@ -901,7 +901,7 @@ static constexpr int16_t _scrollpos24[] = { ScrollPos( 27, 0 ), -1, }; -static constexpr int16_t _scrollpos25[] = { +static constexpr int16_t kScrollPos25[] = { ScrollPos( 36, 0 ), ScrollPos( 37, 0 ), ScrollPos( 38, 1 ), @@ -924,7 +924,7 @@ static constexpr int16_t _scrollpos25[] = { ScrollPos( 55, 9 ), -1, }; -static constexpr int16_t _scrollpos26[] = { +static constexpr int16_t kScrollPos26[] = { ScrollPos( 4, 13 ), ScrollPos( 5, 13 ), ScrollPos( 6, 12 ), @@ -955,7 +955,7 @@ static constexpr int16_t _scrollpos26[] = { ScrollPos( 31, 0 ), -1, }; -static constexpr int16_t _scrollpos27[] = { +static constexpr int16_t kScrollPos27[] = { ScrollPos( 32, 0 ), ScrollPos( 33, 0 ), ScrollPos( 34, 1 ), @@ -986,7 +986,7 @@ static constexpr int16_t _scrollpos27[] = { ScrollPos( 59, 13 ), -1, }; -static constexpr int16_t _scrollpos28[] = { +static constexpr int16_t kScrollPos28[] = { ScrollPos( 6, 13 ), ScrollPos( 7, 13 ), ScrollPos( 8, 12 ), @@ -1017,7 +1017,7 @@ static constexpr int16_t _scrollpos28[] = { ScrollPos( 33, 0 ), -1, }; -static constexpr int16_t _scrollpos29[] = { +static constexpr int16_t kScrollPos29[] = { ScrollPos( 30, 0 ), ScrollPos( 31, 0 ), ScrollPos( 32, 1 ), @@ -1048,7 +1048,7 @@ static constexpr int16_t _scrollpos29[] = { ScrollPos( 57, 13 ), -1, }; -static constexpr int16_t _scrollpos30[] = { +static constexpr int16_t kScrollPos30[] = { ScrollPos( 2, 30 ), ScrollPos( 3, 30 ), ScrollPos( 4, 29 ), @@ -1112,7 +1112,7 @@ static constexpr int16_t _scrollpos30[] = { ScrollPos( 62, 0 ), -1, }; -static constexpr int16_t _scrollpos31[] = { +static constexpr int16_t kScrollPos31[] = { ScrollPos( 1, 0 ), ScrollPos( 2, 1 ), ScrollPos( 3, 1 ), @@ -1176,7 +1176,7 @@ static constexpr int16_t _scrollpos31[] = { ScrollPos( 61, 30 ), -1, }; -static constexpr int16_t _scrollpos32[] = { +static constexpr int16_t kScrollPos32[] = { ScrollPos( 12, 0 ), ScrollPos( 13, 1 ), ScrollPos( 14, 1 ), @@ -1218,7 +1218,7 @@ static constexpr int16_t _scrollpos32[] = { ScrollPos( 50, 19 ), -1, }; -static constexpr int16_t _scrollpos33[] = { +static constexpr int16_t kScrollPos33[] = { ScrollPos( 12, 20 ), ScrollPos( 13, 20 ), ScrollPos( 14, 19 ), @@ -1261,7 +1261,7 @@ static constexpr int16_t _scrollpos33[] = { ScrollPos( 51, 1 ), -1, }; -static constexpr int16_t _scrollpos34[] = { +static constexpr int16_t kScrollPos34[] = { ScrollPos( 2, 14 ), ScrollPos( 3, 14 ), ScrollPos( 4, 13 ), @@ -1293,7 +1293,7 @@ static constexpr int16_t _scrollpos34[] = { ScrollPos( 30, 0 ), -1, }; -static constexpr int16_t _scrollpos35[] = { +static constexpr int16_t kScrollPos35[] = { ScrollPos( 33, 0 ), ScrollPos( 34, 0 ), ScrollPos( 35, 1 ), @@ -1325,7 +1325,7 @@ static constexpr int16_t _scrollpos35[] = { ScrollPos( 61, 14 ), -1, }; -static constexpr int16_t _scrollpos36[] = { +static constexpr int16_t kScrollPos36[] = { ScrollPos( 4, 0 ), ScrollPos( 5, 1 ), ScrollPos( 6, 2 ), @@ -1355,7 +1355,7 @@ static constexpr int16_t _scrollpos36[] = { ScrollPos( 30, 12 ), -1, }; -static constexpr int16_t _scrollpos37[] = { +static constexpr int16_t kScrollPos37[] = { ScrollPos( 32, 13 ), ScrollPos( 33, 12 ), ScrollPos( 34, 12 ), @@ -1386,45 +1386,45 @@ static constexpr int16_t _scrollpos37[] = { -1, }; -static constexpr const int16_t* _scrollPositions[kMaxScrollingTextModes] = { - _scrollpos0, - _scrollpos1, - _scrollpos2, - _scrollpos3, - _scrollpos4, - _scrollpos5, - _scrollpos6, - _scrollpos7, - _scrollpos8, - _scrollpos9, - _scrollpos10, - _scrollpos11, - _scrollpos12, - _scrollpos13, - _scrollpos14, - _scrollpos15, - _scrollpos16, - _scrollpos17, - _scrollpos18, - _scrollpos19, - _scrollpos20, - _scrollpos21, - _scrollpos22, - _scrollpos23, - _scrollpos24, - _scrollpos25, - _scrollpos26, - _scrollpos27, - _scrollpos28, - _scrollpos29, - _scrollpos30, - _scrollpos31, - _scrollpos32, - _scrollpos33, - _scrollpos34, - _scrollpos35, - _scrollpos36, - _scrollpos37, +static constexpr const int16_t* kScrollPositions[kMaxScrollingTextModes] = { + kScrollPos0, + kScrollPos1, + kScrollPos2, + kScrollPos3, + kScrollPos4, + kScrollPos5, + kScrollPos6, + kScrollPos7, + kScrollPos8, + kScrollPos9, + kScrollPos10, + kScrollPos11, + kScrollPos12, + kScrollPos13, + kScrollPos14, + kScrollPos15, + kScrollPos16, + kScrollPos17, + kScrollPos18, + kScrollPos19, + kScrollPos20, + kScrollPos21, + kScrollPos22, + kScrollPos23, + kScrollPos24, + kScrollPos25, + kScrollPos26, + kScrollPos27, + kScrollPos28, + kScrollPos29, + kScrollPos30, + kScrollPos31, + kScrollPos32, + kScrollPos33, + kScrollPos34, + kScrollPos35, + kScrollPos36, + kScrollPos37, }; // clang-format on @@ -1466,7 +1466,7 @@ ImageId ScrollingTextSetup( utf8 scrollString[256]; ScrollingTextFormat(scrollString, 256, scrollText); - const int16_t* scrollingModePositions = _scrollPositions[scrollingMode]; + const int16_t* scrollingModePositions = kScrollPositions[scrollingMode]; std::fill_n(scrollText->bitmap, 320 * 8, 0x00); if (LocalisationService_UseTrueTypeFont()) diff --git a/src/openrct2/drawing/ScrollingText.h b/src/openrct2/drawing/ScrollingText.h index ec3f10100c15..014003c41165 100644 --- a/src/openrct2/drawing/ScrollingText.h +++ b/src/openrct2/drawing/ScrollingText.h @@ -2,7 +2,7 @@ namespace OpenRCT2 { - static auto constexpr MaxScrollingTextLegacyEntries = 32; - static auto constexpr MaxScrollingTextEntries = 256; + static auto constexpr kMaxScrollingTextLegacyEntries = 32; + static auto constexpr kMaxScrollingTextEntries = 256; } // namespace OpenRCT2 diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index c5f537b3f777..8aee4e9abeb6 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -91,14 +91,14 @@ static void DrawLightRain( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x18; y_start = (currentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); } /** @@ -115,28 +115,28 @@ static void DrawHeavyRain( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x10; y_start = (currentTicks * 6) + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 8; y_start = (currentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x18; y_start = (currentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); } static void DrawLightSnow( @@ -153,14 +153,14 @@ static void DrawLightSnow( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = negT + 16 + (cos(cosTick) * 6); y_start = t + 16; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); } static void DrawHeavySnow( @@ -173,26 +173,26 @@ static void DrawHeavySnow( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 4) + 6; y_start = currentTicks + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 2) + 11; y_start = currentTicks + 18; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 3) + 17; y_start = currentTicks + 11; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); } diff --git a/src/openrct2/drawing/Weather.h b/src/openrct2/drawing/Weather.h index 7b30e49fdcc3..37d7721a76c7 100644 --- a/src/openrct2/drawing/Weather.h +++ b/src/openrct2/drawing/Weather.h @@ -19,7 +19,7 @@ namespace OpenRCT2::Drawing } // clang-format off -static constexpr uint8_t RainPattern[] = +static constexpr uint8_t kRainPattern[] = { 32, 32, 0, 12, 0, 14, 0, 16, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, @@ -27,7 +27,7 @@ static constexpr uint8_t RainPattern[] = 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 0, 0 }; -static constexpr uint8_t SnowPattern[] = +static constexpr uint8_t kSnowPattern[] = { 32, 32, 0, 32, 0, 32, 0, 16, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index cd89bf052a4e..53def4d7993c 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -476,7 +476,7 @@ void X8DrawingContext::Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) /** rct2: 0x0097FF04 */ // clang-format off -static constexpr uint16_t Pattern[] = { +static constexpr uint16_t kPattern[] = { 0b0111111110000000, 0b0011111111000000, 0b0001111111100000, @@ -496,7 +496,7 @@ static constexpr uint16_t Pattern[] = { }; /** rct2: 0x0097FF14 */ -static constexpr uint16_t PatternInverse[] = { +static constexpr uint16_t kPatternInverse[] = { 0b1000000001111111, 0b1100000000111111, 0b1110000000011111, @@ -516,9 +516,9 @@ static constexpr uint16_t PatternInverse[] = { }; /** rct2: 0x0097FEFC */ -static constexpr const uint16_t* Patterns[] = { - Pattern, - PatternInverse, +static constexpr const uint16_t* kPatterns[] = { + kPattern, + kPatternInverse, }; // clang-format on @@ -538,12 +538,12 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef if (top >= dpi.y + dpi.height) return; - uint16_t crossPattern = 0; + uint16_t crosskPattern = 0; int32_t startX = left - dpi.x; if (startX < 0) { - crossPattern ^= startX; + crosskPattern ^= startX; startX = 0; } @@ -556,7 +556,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef int32_t startY = top - dpi.y; if (startY < 0) { - crossPattern ^= startY; + crosskPattern ^= startY; startY = 0; } @@ -576,7 +576,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef for (int32_t i = 0; i < height; i++) { uint8_t* nextdst = dst + dpi.LineStride(); - uint32_t p = Numerics::ror32(crossPattern, 1); + uint32_t p = Numerics::ror32(crosskPattern, 1); p = (p & 0xFFFF0000) | width; // Fill every other pixel with the colour @@ -589,7 +589,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef } dst++; } - crossPattern ^= 1; + crosskPattern ^= 1; dst = nextdst; } } @@ -607,10 +607,10 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef // The pattern loops every 15 pixels this is which // part the pattern is on. - int32_t startPatternX = (startX + dpi.x) % 16; - int32_t patternX = startPatternX; + int32_t startkPatternX = (startX + dpi.x) % 16; + int32_t patternX = startkPatternX; - const uint16_t* patternsrc = Patterns[colour >> 28]; // or possibly uint8_t)[esi*4] ? + const uint16_t* patternsrc = kPatterns[colour >> 28]; // or possibly uint8_t)[esi*4] ? for (int32_t numLines = height; numLines > 0; numLines--) { @@ -626,7 +626,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef patternX = (patternX + 1) % 16; dst++; } - patternX = startPatternX; + patternX = startkPatternX; patternY = (patternY + 1) % 16; dst = nextdst; } diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index 61fa380d83d6..ec6e9ab61189 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -45,9 +45,9 @@ namespace OpenRCT2 uint8_t Colour; }; - static constexpr uint32_t MaxWeatherPixels = 0xFFFE; + static constexpr uint32_t kMaxWeatherPixels = 0xFFFE; - size_t _weatherPixelsCapacity = MaxWeatherPixels; + size_t _weatherPixelsCapacity = kMaxWeatherPixels; uint32_t _weatherPixelsCount = 0; WeatherPixel* _weatherPixels = nullptr; diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index ab72c37fecab..f592c727c71b 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -40,7 +40,7 @@ static constexpr uint8_t kDuckAnimationFlyToWater[] = 8, 9, 10, 11, 12, 13 }; -static constexpr uint8_t kkDuckAnimationswim[] = +static constexpr uint8_t kDuckAnimationSwim[] = { 0 }; @@ -60,16 +60,15 @@ static constexpr uint8_t kDuckAnimationFlyAway[] = { 8, 9, 10, 11, 12, 13 }; +// clang-format on -static constexpr const uint8_t * kDuckAnimations[] = -{ - kDuckAnimationFlyToWater, // FLY_TO_WATER - kkDuckAnimationswim, // SWIM - kDuckAnimationDrink, // DRINK - kDuckAnimationDoubleDrink, // DOUBLE_DRINK - kDuckAnimationFlyAway, // FLY_AWAY +static constexpr const uint8_t* kDuckAnimations[] = { + kDuckAnimationFlyToWater, // DuckState::FlyToWater, + kDuckAnimationSwim, // DuckState::Swim, + kDuckAnimationDrink, // DuckState::Drink, + kDuckAnimationDoubleDrink, // DuckState::DoubleDrink, + kDuckAnimationFlyAway, // DuckState::FlyAway, }; -// clang-format on template<> bool EntityBase::Is() const diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index f4592de1d0c1..7791b6597738 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -44,7 +44,7 @@ using namespace OpenRCT2; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; -static bool _entityFlashingList[MAX_ENTITIES]; +static bool _entityFlashingList[kMaxEntities]; static constexpr const uint32_t kSpatialIndexSize = (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) + 1; static constexpr uint32_t kSpatialIndexNullBucket = kSpatialIndexSize - 1; @@ -114,7 +114,7 @@ EntityBase* TryGetEntity(EntityId entityIndex) { auto& gameState = GetGameState(); const auto idx = entityIndex.ToUnderlying(); - return idx >= MAX_ENTITIES ? nullptr : &gameState.Entities[idx].base; + return idx >= kMaxEntities ? nullptr : &gameState.Entities[idx].base; } EntityBase* GetEntity(EntityId entityIndex) @@ -123,7 +123,7 @@ EntityBase* GetEntity(EntityId entityIndex) { return nullptr; } - Guard::Assert(entityIndex.ToUnderlying() < MAX_ENTITIES, "Tried getting entity %u", entityIndex.ToUnderlying()); + Guard::Assert(entityIndex.ToUnderlying() < kMaxEntities, "Tried getting entity %u", entityIndex.ToUnderlying()); return TryGetEntity(entityIndex); } @@ -143,7 +143,7 @@ static void ResetEntityLists() static void ResetFreeIds() { _freeIdList.clear(); - _freeIdList.resize(MAX_ENTITIES); + _freeIdList.resize(kMaxEntities); // List needs to be back to front to simplify removing auto nextId = 0; @@ -165,7 +165,7 @@ const std::list& GetEntityList(const EntityType id) void ResetAllEntities() { // Free all associated Entity pointers prior to zeroing memory - for (int32_t i = 0; i < MAX_ENTITIES; ++i) + for (int32_t i = 0; i < kMaxEntities; ++i) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) @@ -179,7 +179,7 @@ void ResetAllEntities() std::fill(std::begin(gameState.Entities), std::end(gameState.Entities), Entity_t()); OpenRCT2::RideUse::GetHistory().Clear(); OpenRCT2::RideUse::GetTypeHistory().Clear(); - for (int32_t i = 0; i < MAX_ENTITIES; ++i) + for (int32_t i = 0; i < kMaxEntities; ++i) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) @@ -210,7 +210,7 @@ void ResetEntitySpatialIndices() { vec.clear(); } - for (EntityId::UnderlyingType i = 0; i < MAX_ENTITIES; i++) + for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* entity = GetEntity(EntityId::FromUnderlying(i)); if (entity != nullptr && entity->Type != EntityType::Null) @@ -269,7 +269,7 @@ static void EntityReset(EntityBase* entity) entity->Type = EntityType::Null; } -static constexpr uint16_t MAX_MISC_SPRITES = 1600; +static constexpr uint16_t kMaxMiscEntities = 1600; static void AddToEntityList(EntityBase* entity) { @@ -338,13 +338,13 @@ EntityBase* CreateEntity(EntityType type) if (EntityTypeIsMiscEntity(type)) { // Misc sprites are commonly used for effects, give other entity types higher priority. - if (GetMiscEntityCount() >= MAX_MISC_SPRITES) + if (GetMiscEntityCount() >= kMaxMiscEntities) { return nullptr; } - // If there are less than MAX_MISC_SPRITES free slots, ensure other entities can be created. - if (_freeIdList.size() < MAX_MISC_SPRITES) + // If there are less than kMaxMiscEntities free slots, ensure other entities can be created. + if (_freeIdList.size() < kMaxMiscEntities) { return nullptr; } @@ -584,12 +584,12 @@ uint16_t RemoveFloatingEntities() void EntitySetFlashing(EntityBase* entity, bool flashing) { - assert(entity->Id.ToUnderlying() < MAX_ENTITIES); + assert(entity->Id.ToUnderlying() < kMaxEntities); _entityFlashingList[entity->Id.ToUnderlying()] = flashing; } bool EntityGetFlashing(EntityBase* entity) { - assert(entity->Id.ToUnderlying() < MAX_ENTITIES); + assert(entity->Id.ToUnderlying() < kMaxEntities); return _entityFlashingList[entity->Id.ToUnderlying()]; } diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index ebb1a27eaedc..28fb5768d975 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -27,7 +27,7 @@ namespace OpenRCT2 }; } // namespace OpenRCT2 -constexpr uint16_t MAX_ENTITIES = 65535; +constexpr uint16_t kMaxEntities = 65535; EntityBase* GetEntity(EntityId sprite_idx); diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 6ecde530dc27..dc4b7c28449b 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -58,8 +58,8 @@ static constexpr std::array _fountainDirectionsPositive = { CoordsXY{ 0, 0 }, CoordsXY{ 0, kCoordsXYStep }, }; -constexpr auto _FountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 -constexpr auto _FountainChanceOfStoppingRandomMode = 0x2000; // 0.125 +static constexpr auto kFountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 +static constexpr auto kFountainChanceOfStoppingRandomMode = 0x2000; // 0.125 // rct2: 0x0097F040 const uint8_t _fountainDirections[] = { @@ -300,7 +300,7 @@ void JumpingFountain::GoToEdge(const CoordsXYZ& newLoc, const int32_t availableD } const uint32_t randomIndex = ScenarioRand(); - if ((randomIndex & 0xFFFF) < _FountainChanceOfStoppingEdgeMode) + if ((randomIndex & 0xFFFF) < kFountainChanceOfStoppingEdgeMode) { return; } @@ -370,7 +370,7 @@ void JumpingFountain::Split(const CoordsXYZ& newLoc, int32_t availableDirections void JumpingFountain::Random(const CoordsXYZ& newLoc, int32_t availableDirections) const { const uint32_t randomIndex = ScenarioRand(); - if ((randomIndex & 0xFFFF) >= _FountainChanceOfStoppingRandomMode) + if ((randomIndex & 0xFFFF) >= kFountainChanceOfStoppingRandomMode) { int32_t direction = randomIndex & 7; while (!(availableDirections & (1 << direction))) @@ -409,8 +409,8 @@ void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const PROFILED_FUNCTION(); // TODO: Move into sprites.h - constexpr uint32_t JumpingFountainSnowBaseImage = 23037; - constexpr uint32_t JumpingFountainWaterBaseImage = 22973; + constexpr uint32_t kJumpingFountainSnowBaseImage = 23037; + constexpr uint32_t kJumpingFountainWaterBaseImage = 22973; DrawPixelInfo& dpi = session.DPI; if (dpi.zoom_level > ZoomLevel{ 0 }) @@ -433,8 +433,8 @@ void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const isAntiClockwise = !isAntiClockwise; } - uint32_t baseImageId = (FountainType == JumpingFountainType::Snow) ? JumpingFountainSnowBaseImage - : JumpingFountainWaterBaseImage; + uint32_t baseImageId = (FountainType == JumpingFountainType::Snow) ? kJumpingFountainSnowBaseImage + : kJumpingFountainWaterBaseImage; auto imageId = ImageId(baseImageId + imageDirection * 16 + frame); constexpr std::array antiClockWiseBoundingBoxes = { CoordsXY{ -kCoordsXYStep, -3 }, diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 560183e49421..006ca7eea65f 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -86,7 +86,7 @@ using namespace OpenRCT2::Numerics; // entrance of the slide. Up to 4 waypoints for each 4 sides that an ride entrance can be located // and 4 different rotations of the ride. 4 * 4 * 4 = 64 locations. // clang-format off -static constexpr CoordsXY SpiralSlideWalkingPath[64] = { +static constexpr CoordsXY kSpiralSlideWalkingPath[64] = { { 56, 8 }, { 8, 8 }, { 8, 32 }, @@ -154,7 +154,7 @@ static constexpr CoordsXY SpiralSlideWalkingPath[64] = { }; /** rct2: 0x00981F4C, 0x00981F4E */ -static constexpr CoordsXY _WatchingPositionOffsets[] = { +static constexpr CoordsXY kWatchingPositionOffsets[] = { { 7, 5 }, { 5, 25 }, { 25, 5 }, @@ -197,7 +197,7 @@ static constexpr ride_rating NauseaMaximumThresholds[] = { }; /** rct2: 009823AC */ -static constexpr PeepThoughtType crowded_thoughts[] = { +static constexpr PeepThoughtType kCrowdedThoughts[] = { PeepThoughtType::Lost, PeepThoughtType::Tired, PeepThoughtType::BadLitter, @@ -436,7 +436,7 @@ static struct }; // These arrays contain the base minimum and maximum nausea ratings for peeps, based on their nausea tolerance level. -static constexpr ride_rating NauseaMinimumThresholds[] = { +static constexpr ride_rating kNauseaMinimumThresholds[] = { 0, 0, 200, @@ -929,7 +929,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) * is executed to once every four calls. */ if (PeepFlags & PEEP_FLAGS_CROWDED) { - PeepThoughtType thought_type = crowded_thoughts[ScenarioRand() & 0xF]; + PeepThoughtType thought_type = kCrowdedThoughts[ScenarioRand() & 0xF]; if (thought_type != PeepThoughtType::None) { InsertNewThought(thought_type); @@ -2797,7 +2797,7 @@ static int16_t PeepCalculateRideIntensityNauseaSatisfaction(Guest* peep, const R // Although it's not shown in the interface, a peep with Average or High nausea tolerance // has a minimum preferred nausea value. (For peeps with None or Low, this is set to zero.) - ride_rating minNausea = NauseaMinimumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; + ride_rating minNausea = kNauseaMinimumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; ride_rating maxNausea = NauseaMaximumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; if (minNausea <= ride.ratings.nausea && maxNausea >= ride.ratings.nausea) { @@ -3187,12 +3187,12 @@ static void PeepHeadForNearestRide(Guest* peep, bool considerOnlyCloseRides, T p else { // Take nearby rides into consideration - constexpr auto searchRadius = 10 * 32; + constexpr auto kSearchRadius = 10 * 32; int32_t cx = floor2(peep->x, 32); int32_t cy = floor2(peep->y, 32); - for (auto x = cx - searchRadius; x <= cx + searchRadius; x += kCoordsXYStep) + for (auto x = cx - kSearchRadius; x <= cx + kSearchRadius; x += kCoordsXYStep) { - for (auto y = cy - searchRadius; y <= cy + searchRadius; y += kCoordsXYStep) + for (auto y = cy - kSearchRadius; y <= cy + kSearchRadius; y += kCoordsXYStep) { auto location = CoordsXY{ x, y }; if (!MapIsLocationValid(location)) @@ -3590,7 +3590,7 @@ void PeepUpdateRideLeaveEntranceSpiralSlide(Guest* peep, Ride& ride, CoordsXYZD& peep->Var37 = (entrance_loc.direction << 2) | (direction_track << 4); - entrance_loc += SpiralSlideWalkingPath[peep->Var37]; + entrance_loc += kSpiralSlideWalkingPath[peep->Var37]; peep->SetDestination(entrance_loc); peep->CurrentCar = 0; @@ -4715,7 +4715,7 @@ void Guest::UpdateRideApproachSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); RideSubState = PeepRideSubState::LeaveSpiralSlide; @@ -4729,13 +4729,13 @@ void Guest::UpdateRideApproachSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); } /** rct2: 0x00981F0C, 0x00981F0E */ -static constexpr CoordsXY _SpiralSlideEnd[] = { +static constexpr CoordsXY kSpiralSlideEnd[] = { { 25, 56 }, { 56, 7 }, { 7, -24 }, @@ -4743,7 +4743,7 @@ static constexpr CoordsXY _SpiralSlideEnd[] = { }; /** rct2: 0x00981F1C, 0x00981F1E */ -static constexpr CoordsXY _SpiralSlideEndWaypoint[] = { +static constexpr CoordsXY kSpiralSlideEndWaypoint[] = { { 8, 56 }, { 56, 24 }, { 24, -24 }, @@ -4797,12 +4797,12 @@ void Guest::UpdateRideOnSpiralSlide() uint8_t dir = (Var37 / 4) & 3; // Set the location that the peep walks to go on slide again - destination = newLocation + _SpiralSlideEndWaypoint[dir]; + destination = newLocation + kSpiralSlideEndWaypoint[dir]; SetDestination(destination); // Move the peep sprite to just at the end of the slide - newLocation.x += _SpiralSlideEnd[dir].x; - newLocation.y += _SpiralSlideEnd[dir].y; + newLocation.x += kSpiralSlideEnd[dir].x; + newLocation.y += kSpiralSlideEnd[dir].y; MoveTo({ newLocation, z }); @@ -4827,7 +4827,7 @@ void Guest::UpdateRideOnSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); RideSubState = PeepRideSubState::ApproachSpiralSlide; @@ -4868,7 +4868,7 @@ void Guest::UpdateRideLeaveSpiralSlide() [[maybe_unused]] const auto& rtd = ride->GetRideTypeDescriptor(); assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); return; @@ -4894,7 +4894,7 @@ void Guest::UpdateRideLeaveSpiralSlide() } /** rct2: 0x00981FE4 */ -static constexpr uint8_t _MazeGetNewDirectionFromEdge[][4] = { +static constexpr uint8_t kMazeGetNewDirectionFromEdge[][4] = { { 15, 7, 15, 7 }, { 11, 3, 11, 3 }, { 7, 15, 7, 15 }, @@ -4902,7 +4902,7 @@ static constexpr uint8_t _MazeGetNewDirectionFromEdge[][4] = { }; /** rct2: 0x00981FF4 */ -static constexpr uint8_t _MazeCurrentDirectionToOpenHedge[][4] = { +static constexpr uint8_t kMazeCurrentDirectionToOpenHedge[][4] = { { 1, 2, 14, 0 }, { 4, 5, 6, 2 }, { 6, 8, 9, 10 }, @@ -4960,7 +4960,7 @@ void Guest::UpdateRideMazePathfinding() uint8_t mazeReverseLastEdge = DirectionReverse(MazeLastEdge); for (uint8_t i = 0; i < kNumOrthogonalDirections; ++i) { - if (!(mazeEntry & (1 << _MazeCurrentDirectionToOpenHedge[Var37 / 4][i])) && i != mazeReverseLastEdge) + if (!(mazeEntry & (1 << kMazeCurrentDirectionToOpenHedge[Var37 / 4][i])) && i != mazeReverseLastEdge) { hedges[openCount++] = i; } @@ -4968,7 +4968,7 @@ void Guest::UpdateRideMazePathfinding() if (openCount == 0) { - if ((mazeEntry & (1 << _MazeCurrentDirectionToOpenHedge[Var37 / 4][mazeReverseLastEdge]))) + if ((mazeEntry & (1 << kMazeCurrentDirectionToOpenHedge[Var37 / 4][mazeReverseLastEdge]))) { return; } @@ -5018,7 +5018,7 @@ void Guest::UpdateRideMazePathfinding() return; case maze_type::hedge: SetDestination(targetLoc); - Var37 = _MazeGetNewDirectionFromEdge[Var37 / 4][chosenEdge]; + Var37 = kMazeGetNewDirectionFromEdge[Var37 / 4][chosenEdge]; MazeLastEdge = chosenEdge; break; case maze_type::entrance_or_exit: @@ -5552,8 +5552,8 @@ void Guest::UpdateWalking() SetState(PeepState::Watching); SubState = 0; - int32_t destX = (x & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].x; - int32_t destY = (y & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].y; + int32_t destX = (x & 0xFFE0) + kWatchingPositionOffsets[Var37 & 0x1F].x; + int32_t destY = (y & 0xFFE0) + kWatchingPositionOffsets[Var37 & 0x1F].y; SetDestination({ destX, destY }, 3); @@ -6957,7 +6957,7 @@ void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft) } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR) @@ -6972,7 +6972,7 @@ void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft) void Guest::InsertNewThought(PeepThoughtType thought_type) { - InsertNewThought(thought_type, PeepThoughtItemNone); + InsertNewThought(thought_type, kPeepThoughtItemNone); } void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) @@ -7043,7 +7043,7 @@ static constexpr PeepNauseaTolerance nausea_tolerance_distribution[] = { }; /** rct2: 0x009823BC */ -static constexpr uint8_t trouser_colours[] = { +static constexpr uint8_t kTrouserColours[] = { COLOUR_BLACK, COLOUR_GREY, COLOUR_LIGHT_BROWN, @@ -7076,7 +7076,7 @@ static constexpr uint8_t trouser_colours[] = { }; /** rct2: 0x009823D5 */ -static constexpr uint8_t tshirt_colours[] = { +static constexpr uint8_t kTshirtColours[] = { COLOUR_BLACK, COLOUR_GREY, COLOUR_LIGHT_BROWN, @@ -7296,11 +7296,11 @@ Guest* Guest::Generate(const CoordsXYZ& coords) peep->Angriness = 0; peep->TimeLost = 0; - uint8_t tshirtColour = static_cast(ScenarioRand() % std::size(tshirt_colours)); - peep->TshirtColour = tshirt_colours[tshirtColour]; + uint8_t tshirtColour = static_cast(ScenarioRand() % std::size(kTshirtColours)); + peep->TshirtColour = kTshirtColours[tshirtColour]; - uint8_t trousersColour = static_cast(ScenarioRand() % std::size(trouser_colours)); - peep->TrousersColour = trouser_colours[trousersColour]; + uint8_t trousersColour = static_cast(ScenarioRand() % std::size(kTrouserColours)); + peep->TrousersColour = kTrouserColours[trousersColour]; /* Minimum energy is capped at 32 and maximum at 128, so this initialises * a peep with approx 34%-100% energy. (65 - 32) / (128 - 32) ≈ 34% */ @@ -7346,7 +7346,7 @@ enum PEEP_FACE_OFFSET_VERY_VERY_HAPPY, }; -static constexpr int32_t face_sprite_small[] = { +static constexpr int32_t kFaceSpriteSmall[] = { SPR_PEEP_SMALL_FACE_ANGRY, SPR_PEEP_SMALL_FACE_VERY_VERY_SICK, SPR_PEEP_SMALL_FACE_VERY_SICK, @@ -7362,7 +7362,7 @@ static constexpr int32_t face_sprite_small[] = { SPR_PEEP_SMALL_FACE_VERY_VERY_HAPPY, }; -static constexpr int32_t face_sprite_large[] = { +static constexpr int32_t kFaceSpriteLarge[] = { SPR_PEEP_LARGE_FACE_ANGRY_0, SPR_PEEP_LARGE_FACE_VERY_VERY_SICK_0, SPR_PEEP_LARGE_FACE_VERY_SICK_0, @@ -7420,7 +7420,7 @@ static int32_t GetFaceSpriteOffset(Guest* peep) */ int32_t GetPeepFaceSpriteSmall(Guest* peep) { - return face_sprite_small[GetFaceSpriteOffset(peep)]; + return kFaceSpriteSmall[GetFaceSpriteOffset(peep)]; } /** @@ -7429,7 +7429,7 @@ int32_t GetPeepFaceSpriteSmall(Guest* peep) */ int32_t GetPeepFaceSpriteLarge(Guest* peep) { - return face_sprite_large[GetFaceSpriteOffset(peep)]; + return kFaceSpriteLarge[GetFaceSpriteOffset(peep)]; } /** @@ -7682,7 +7682,7 @@ void Guest::RemoveRideFromMemory(RideId rideId) // Last slot is now free. auto& lastEntry = Thoughts.back(); lastEntry.type = PeepThoughtType::None; - lastEntry.item = PeepThoughtItemNone; + lastEntry.item = kPeepThoughtItemNone; } } diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index 03598938c49c..41c6b85a9499 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -185,7 +185,7 @@ enum class PeepNauseaTolerance : uint8_t High }; -static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); +static constexpr uint16_t kPeepThoughtItemNone = std::numeric_limits::max(); struct PeepThought { diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 12177c751628..b0f45d58d3ad 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -141,7 +141,7 @@ static const StringId litterNames[12] = { StringId Litter::GetName() const { if (EnumValue(SubType) >= std::size(litterNames)) - return STR_NONE; + return kStringIdNone; return litterNames[EnumValue(SubType)]; } @@ -165,7 +165,7 @@ struct LitterSprite }; /** rct2: 0x0097EF6C */ -static constexpr LitterSprite _litterSprites[] = { +static constexpr LitterSprite kLitterSprites[] = { { SPR_LITTER_SICK, 0x1 }, { SPR_LITTER_SICK_ALT, 0x1 }, { SPR_LITTER_EMPTY_CAN, 0x1 }, @@ -192,9 +192,9 @@ void Litter::Paint(PaintSession& session, int32_t imageDirection) const imageDirection >>= 3; // Some litter types have only 1 direction so remove // anything that isn't required. - imageDirection &= _litterSprites[EnumValue(SubType)].direction_mask; + imageDirection &= kLitterSprites[EnumValue(SubType)].direction_mask; - uint32_t image_id = imageDirection + _litterSprites[EnumValue(SubType)].base_id; + uint32_t image_id = imageDirection + kLitterSprites[EnumValue(SubType)].base_id; // In the following call to PaintAddImageAsParent, we add 4 (instead of 2) to the // bound_box_offset_z to make sure litter is drawn on top of railways diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index cf4f9b9d584b..c47a56b1011e 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -25,7 +25,7 @@ using namespace OpenRCT2; -static constexpr CoordsXY _moneyEffectMoveOffset[] = { +static constexpr CoordsXY kMoneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, @@ -132,8 +132,8 @@ void MoneyEffect::Update() { newZ += 1; } - newY += _moneyEffectMoveOffset[GetCurrentRotation()].y; - newX += _moneyEffectMoveOffset[GetCurrentRotation()].x; + newY += kMoneyEffectMoveOffset[GetCurrentRotation()].y; + newX += kMoneyEffectMoveOffset[GetCurrentRotation()].x; MoveTo({ newX, newY, newZ }); diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index 540ff849896c..489772deb858 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -20,7 +20,7 @@ #include // TODO: Create constants in sprites.h -static constexpr uint32_t _VehicleCrashParticleSprites[kCrashedVehicleParticleNumberTypes] = { +static constexpr uint32_t kVehicleCrashParticleSprites[kCrashedVehicleParticleNumberTypes] = { 22577, 22589, 22601, 22613, 22625, }; @@ -177,7 +177,7 @@ void VehicleCrashParticle::Paint(PaintSession& session, int32_t imageDirection) return; } - uint32_t imageId = _VehicleCrashParticleSprites[crashed_sprite_base] + frame / 256; + uint32_t imageId = kVehicleCrashParticleSprites[crashed_sprite_base] + frame / 256; auto image = ImageId(imageId, colour[0], colour[1]); PaintAddImageAsParent(session, image, { 0, 0, z }, { 1, 1, 0 }); } diff --git a/src/openrct2/entity/PatrolArea.h b/src/openrct2/entity/PatrolArea.h index f0c1793fd97e..3f1de627d7c3 100644 --- a/src/openrct2/entity/PatrolArea.h +++ b/src/openrct2/entity/PatrolArea.h @@ -17,8 +17,8 @@ // The number of elements in the GameState_t.StaffPatrolAreas array per staff member. Every bit in the array represents a 4x4 // square. Right now, it's a 32-bit array like in RCT2. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a // 256x256 map. -constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = kMaximumMapSizeTechnical / 4; -constexpr size_t STAFF_PATROL_AREA_SIZE = (STAFF_PATROL_AREA_BLOCKS_PER_LINE * STAFF_PATROL_AREA_BLOCKS_PER_LINE) / 32; +constexpr size_t kStaffPatrolAreaBlocksPerLine = kMaximumMapSizeTechnical / 4; +constexpr size_t kStaffPatrolAreaSize = (kStaffPatrolAreaBlocksPerLine * kStaffPatrolAreaBlocksPerLine) / 32; class PatrolArea { diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 95ae2d995740..c1e756056187 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -400,7 +400,7 @@ void Peep::StateReset() } /** rct2: 0x00981D7C, 0x00981D7E */ -static constexpr CoordsXY walkingOffsetByDirection[kNumOrthogonalDirections] = { +static constexpr CoordsXY kWalkingOffsetByDirection[kNumOrthogonalDirections] = { { -2, 0 }, { 0, 2 }, { 2, 0 }, @@ -517,7 +517,7 @@ std::optional Peep::UpdateWalkingAction(const CoordsXY& differenceLoc, Orientation = nextDirection * 8; CoordsXY loc = { x, y }; - loc += walkingOffsetByDirection[nextDirection]; + loc += kWalkingOffsetByDirection[nextDirection]; UpdateWalkingAnimation(); @@ -662,7 +662,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) } if (tileElement == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } // Set the coordinate of destination to be exactly @@ -1452,7 +1452,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_ON_RIDE).Add(STR_NONE); + ft.Add(STR_ON_RIDE).Add(kStringIdNone); } break; } @@ -1466,7 +1466,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1560,7 +1560,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } break; @@ -1574,7 +1574,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1588,7 +1588,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1602,14 +1602,14 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } } } -static constexpr StringId _staffNames[] = { +static constexpr StringId kStaffNames[] = { STR_HANDYMAN_X, STR_MECHANIC_X, STR_SECURITY_GUARD_X, @@ -1642,12 +1642,12 @@ void Peep::FormatNameTo(Formatter& ft) const else if (isStaff) { auto staffNameIndex = static_cast(staff->AssignedStaffType); - if (staffNameIndex >= std::size(_staffNames)) + if (staffNameIndex >= std::size(kStaffNames)) { staffNameIndex = 0; } - ft.Add(_staffNames[staffNameIndex]); + ft.Add(kStaffNames[staffNameIndex]); ft.Add(PeepId); } else diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index f18a1dc4786c..0365ed88e2d4 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -25,7 +25,7 @@ constexpr uint8_t kPeepMinEnergy = 32; constexpr uint8_t kPeepMaxEnergy = 128; constexpr uint8_t kPeepMaxEnergyTarget = 255; // Oddly, this differs from max energy! -constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * kCoordsZStep; +constexpr auto kPeepClearanceHeight = 4 * kCoordsZStep; class Formatter; struct TileElement; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 0aec15ce01d7..ae7136ccc119 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -130,7 +130,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons uint8_t total = 0; uint8_t pathcount = 0; uint8_t widecount = 0; - for (Direction adjac_dir : ALL_DIRECTIONS) + for (Direction adjac_dir : kAllDirections) { auto adjacPos = staffPos + CoordsXYZ{ CoordsDirectionDelta[adjac_dir].x, CoordsDirectionDelta[adjac_dir].y, 0 }; @@ -585,10 +585,10 @@ Direction Staff::DirectionSurface(Direction initialDirection) const direction &= 3; - if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, direction)) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + kPeepClearanceHeight }, direction)) continue; - if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, DirectionReverse(direction))) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + kPeepClearanceHeight }, DirectionReverse(direction))) continue; CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[direction]; @@ -989,7 +989,7 @@ GameActions::Result StaffSetColour(StaffType staffType, colour_t value) } /** rct2: 0x009929C8 */ -static constexpr CoordsXY _MowingWaypoints[] = { +static constexpr CoordsXY kMowingWaypoints[] = { { 28, 28 }, { 28, 4 }, { 20, 4 }, { 20, 28 }, { 12, 28 }, { 12, 4 }, { 4, 4 }, { 4, 28 }, }; @@ -1018,13 +1018,13 @@ void Staff::UpdateMowing() SwitchToSpecialSprite(2); } - if (Var37 == std::size(_MowingWaypoints)) + if (Var37 == std::size(kMowingWaypoints)) { StateReset(); return; } - auto destination = _MowingWaypoints[Var37] + NextLoc; + auto destination = kMowingWaypoints[Var37] + NextLoc; SetDestination(destination); if (Var37 != 7) @@ -1436,7 +1436,7 @@ void Staff::UpdateAnswering() } /** rct2: 0x00992A5C */ -static constexpr CoordsXY _WateringUseOffsets[] = { +static constexpr CoordsXY kWateringUseOffsets[] = { { 3, 16 }, { 16, 29 }, { 29, 16 }, { 16, 3 }, { 3, 29 }, { 29, 29 }, { 29, 3 }, { 3, 3 }, }; @@ -1502,7 +1502,7 @@ bool Staff::UpdatePatrollingFindWatering() Var37 = chosen_position; SubState = 0; - auto destination = _WateringUseOffsets[chosen_position] + GetLocation().ToTileStart(); + auto destination = kWateringUseOffsets[chosen_position] + GetLocation().ToTileStart(); SetDestination(destination, 3); return true; @@ -1599,7 +1599,7 @@ bool Staff::UpdatePatrollingFindGrass() Var37 = 0; // Original code used .y for both x and y. Changed to .x to make more sense (both x and y are 28) - auto destination = _MowingWaypoints[0] + NextLoc; + auto destination = kMowingWaypoints[0] + NextLoc; SetDestination(destination, 3); return true; } @@ -2114,7 +2114,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride& ride) } /** rct2: 0x00992A3C */ -static constexpr CoordsXY _StationFixingOffsets[] = { +static constexpr CoordsXY kStationFixingOffsets[] = { { -12, 0 }, { 0, 12 }, { 12, 0 }, @@ -2151,7 +2151,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride& ride) } int32_t trackDirection = tileElement->GetDirection(); - CoordsXY offset = _StationFixingOffsets[trackDirection]; + CoordsXY offset = kStationFixingOffsets[trackDirection]; stationPos.x += 16 + offset.x; if (offset.x == 0) @@ -2258,7 +2258,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride& ride) // Loc6C12ED: auto destination = CoordsXY{ input.x + 16, input.y + 16 }; - auto offset = _StationFixingOffsets[stationDirection]; + auto offset = kStationFixingOffsets[stationDirection]; destination.x -= offset.x; if (offset.x == 0) diff --git a/src/openrct2/entity/Yaw.hpp b/src/openrct2/entity/Yaw.hpp index df2f214b0d84..1c43168e25c2 100644 --- a/src/openrct2/entity/Yaw.hpp +++ b/src/openrct2/entity/Yaw.hpp @@ -29,10 +29,10 @@ namespace OpenRCT2::Entity::Yaw // Sprites32 represents the precision of the base rotation precision. Base rotation is the precision of // EntityBase.sprite_direction - constexpr int32_t BaseRotation = 32; + constexpr int32_t kBaseRotation = 32; // The first value represents None, the last value represents 64 which has not yet been implemented - constexpr uint8_t PrecisionOffset[] = { 5, 5, 4, 3, 2, 1, 0, 0 }; + constexpr uint8_t kPrecisionOffset[] = { 5, 5, 4, 3, 2, 1, 0, 0 }; [[nodiscard]] constexpr int32_t Add(int32_t yaw1, int32_t yaw2) { @@ -65,7 +65,7 @@ namespace OpenRCT2::Entity::Yaw [[nodiscard]] constexpr int32_t YawToPrecision(int32_t yaw, SpritePrecision precision) { - return yaw >> PrecisionOffset[EnumValue(precision)]; + return yaw >> kPrecisionOffset[EnumValue(precision)]; } [[nodiscard]] constexpr uint8_t NumSpritesPrecision(SpritePrecision precision) diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index b732633506ad..00e086b554c8 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -87,7 +87,7 @@ using namespace OpenRCT2; using arguments_t = std::vector; using OpenRCT2::Date; -static constexpr const char* ClimateNames[] = { +static constexpr const char* kClimateNames[] = { "cool_and_wet", "warm", "hot_and_dry", @@ -675,7 +675,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar else if (argv[0] == "climate") { console.WriteFormatLine( - "climate %s (%d)", ClimateNames[EnumValue(gameState.Climate)], EnumValue(gameState.Climate)); + "climate %s (%d)", kClimateNames[EnumValue(gameState.Climate)], EnumValue(gameState.Climate)); } else if (argv[0] == "game_speed") { @@ -925,7 +925,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar { for (newClimate = 0; newClimate < static_cast(ClimateType::Count); newClimate++) { - if (argv[1] == ClimateNames[newClimate]) + if (argv[1] == kClimateNames[newClimate]) { invalidArgs = false; break; @@ -1113,7 +1113,7 @@ static void ConsoleCommandLoadObject(InteractiveConsole& console, const argument // Automatically research the ride so it's supported by the game. const auto* rideEntry = GetRideEntryByIndex(groupIndex); - for (int32_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (int32_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { auto rideType = rideEntry->ride_type[j]; if (rideType != RIDE_TYPE_NULL) @@ -1282,7 +1282,7 @@ static void ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unused auto bannerCount = GetNumBanners(); - console.WriteFormatLine("Sprites: %d/%d", spriteCount, MAX_ENTITIES); + console.WriteFormatLine("Sprites: %d/%d", spriteCount, kMaxEntities); console.WriteFormatLine("Map Elements: %zu/%d", tileElementCount, MAX_TILE_ELEMENTS); console.WriteFormatLine("Banners: %d/%zu", bannerCount, MAX_BANNERS); console.WriteFormatLine("Rides: %d/%d", rideCount, OpenRCT2::Limits::kMaxRidesInPark); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index b2f4942862e6..8c1cc808804c 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -98,11 +98,11 @@ void ScreenshotCheck() Formatter ft; ft.Add(STR_STRING); ft.Add(filename.c_str()); - ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft, true); + ContextShowError(STR_SCREENSHOT_SAVED_AS, kStringIdNone, ft, true); } else { - ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}, true); + ContextShowError(STR_SCREENSHOT_FAILED, kStringIdNone, {}, true); } // redraw_weather(); @@ -360,12 +360,12 @@ void ScreenshotGiant() Formatter ft; ft.Add(STR_STRING); ft.Add(filename.c_str()); - ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft, true); + ContextShowError(STR_SCREENSHOT_SAVED_AS, kStringIdNone, ft, true); } catch (const std::exception& e) { LOG_ERROR("%s", e.what()); - ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}, true); + ContextShowError(STR_SCREENSHOT_FAILED, kStringIdNone, {}, true); } ReleaseDPI(dpi); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index bc4daf17e2cd..ce878ff588e8 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -315,14 +315,14 @@ namespace OpenRCT2 auto mapSizeMinus2 = GetMapSizeMinus2(); if (pos.x > mapSizeMinus2.x && pos.y > mapSizeMinus2.y) { - static constexpr CoordsXY corr[] = { + static constexpr CoordsXY kCorr[] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 }, }; - pos.x += corr[rotation].x * height; - pos.y += corr[rotation].y * height; + pos.x += kCorr[rotation].x * height; + pos.y += kCorr[rotation].y * height; } } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 3b43670f68d9..fc2e3a2efe2e 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -109,7 +109,7 @@ enum class ViewportVisibility : uint8_t namespace OpenRCT2 { - constexpr uint16_t ViewportInteractionItemAll = std::numeric_limits::max(); + constexpr uint16_t kViewportInteractionItemAll = std::numeric_limits::max(); struct InteractionInfo { diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index e89826f95a5f..f6ef3ec91de5 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -82,7 +82,7 @@ namespace OpenRCT2 StringId text; utf8* string; }; - StringId tooltip{ STR_NONE }; + StringId tooltip{ kStringIdNone }; // New properties WidgetFlags flags{}; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 184c3351e421..80463d2fe43f 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2 // converted from uint16_t values at 0x009A41EC - 0x009A4230 // these are percentage coordinates of the viewport to centre to, if a window is obscuring a location, the next is tried // clang-format off -static constexpr float window_scroll_locations[][2] = { +static constexpr float kWindowScrollLocations[][2] = { { 0.5f, 0.5f }, { 0.75f, 0.5f }, { 0.25f, 0.5f }, @@ -598,8 +598,8 @@ static constexpr float window_scroll_locations[][2] = { bool found = false; while (!found) { - 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 x2 = w.viewport->pos.x + static_cast(w.viewport->width * kWindowScrollLocations[i][0]); + auto y2 = w.viewport->pos.y + static_cast(w.viewport->height * kWindowScrollLocations[i][1]); auto it = WindowGetIterator(&w); for (; it != g_window_list.end(); it++) @@ -622,7 +622,7 @@ static constexpr float window_scroll_locations[][2] = { { found = true; } - if (i >= static_cast(std::size(window_scroll_locations))) + if (i >= static_cast(std::size(kWindowScrollLocations))) { i = 0; found = true; @@ -635,8 +635,8 @@ static constexpr float window_scroll_locations[][2] = { if (!(w.flags & WF_NO_SCROLLING)) { w.savedViewPos = screenCoords - - ScreenCoordsXY{ static_cast(w.viewport->ViewWidth() * window_scroll_locations[i][0]), - static_cast(w.viewport->ViewHeight() * window_scroll_locations[i][1]) }; + - ScreenCoordsXY{ static_cast(w.viewport->ViewWidth() * kWindowScrollLocations[i][0]), + static_cast(w.viewport->ViewHeight() * kWindowScrollLocations[i][1]) }; w.flags |= WF_SCROLLING_TO_LOCATION; } } @@ -1240,7 +1240,7 @@ static constexpr float window_scroll_locations[][2] = { void WindowFollowSprite(WindowBase& w, EntityId spriteIndex) { - if (spriteIndex.ToUnderlying() < MAX_ENTITIES || spriteIndex.IsNull()) + if (spriteIndex.ToUnderlying() < kMaxEntities || spriteIndex.IsNull()) { w.viewport_smart_follow_sprite = spriteIndex; } diff --git a/src/openrct2/localisation/LocalisationService.cpp b/src/openrct2/localisation/LocalisationService.cpp index f96f68ea8472..b5a702db9421 100644 --- a/src/openrct2/localisation/LocalisationService.cpp +++ b/src/openrct2/localisation/LocalisationService.cpp @@ -24,13 +24,13 @@ using namespace OpenRCT2; using namespace OpenRCT2::Localisation; -static constexpr uint16_t BASE_OBJECT_STRING_ID = 0x2000; -static constexpr uint16_t MAX_OBJECT_CACHED_STRINGS = 0x5000 - BASE_OBJECT_STRING_ID; +static constexpr uint16_t kBaseObjectStringID = 0x2000; +static constexpr uint16_t kMaxObjectCachedStrings = 0x5000 - kBaseObjectStringID; LocalisationService::LocalisationService(const std::shared_ptr& env) : _env(env) { - for (StringId stringId = BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS; stringId >= BASE_OBJECT_STRING_ID; stringId--) + for (StringId stringId = kBaseObjectStringID + kMaxObjectCachedStrings; stringId >= kBaseObjectStringID; stringId--) { _availableObjectStringIds.push(stringId); } @@ -41,13 +41,13 @@ LocalisationService::~LocalisationService() = default; const char* LocalisationService::GetString(StringId id) const { - if (id == STR_EMPTY) + if (id == kStringIdEmpty) { return ""; } - else if (id >= BASE_OBJECT_STRING_ID && id < BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS) + else if (id >= kBaseObjectStringID && id < kBaseObjectStringID + kMaxObjectCachedStrings) { - size_t index = id - BASE_OBJECT_STRING_ID; + size_t index = id - kBaseObjectStringID; if (index < _objectStrings.size()) { return _objectStrings[index].c_str(); @@ -55,7 +55,7 @@ const char* LocalisationService::GetString(StringId id) const return "(unallocated string)"; } - else if (id != STR_NONE) + else if (id != kStringIdNone) { for (const auto& language : _loadedLanguages) { @@ -147,13 +147,13 @@ StringId LocalisationService::AllocateObjectString(const std::string& target) { if (_availableObjectStringIds.empty()) { - return STR_EMPTY; + return kStringIdEmpty; } auto stringId = _availableObjectStringIds.top(); _availableObjectStringIds.pop(); - size_t index = stringId - BASE_OBJECT_STRING_ID; + size_t index = stringId - kBaseObjectStringID; if (index >= _objectStrings.size()) { _objectStrings.resize(index + 1); @@ -165,9 +165,9 @@ StringId LocalisationService::AllocateObjectString(const std::string& target) void LocalisationService::FreeObjectString(StringId stringId) { - if (stringId != STR_EMPTY) + if (stringId != kStringIdEmpty) { - size_t index = stringId - BASE_OBJECT_STRING_ID; + size_t index = stringId - kBaseObjectStringID; if (index < _objectStrings.size()) { _objectStrings[index] = {}; diff --git a/src/openrct2/localisation/StringIdType.h b/src/openrct2/localisation/StringIdType.h index 0513ce9fe47e..522a962eeaeb 100644 --- a/src/openrct2/localisation/StringIdType.h +++ b/src/openrct2/localisation/StringIdType.h @@ -13,8 +13,8 @@ using StringId = uint16_t; -constexpr StringId STR_NONE = 0xFFFF; -constexpr StringId STR_EMPTY = 0; +constexpr StringId kStringIdNone = 0xFFFF; +constexpr StringId kStringIdEmpty = 0; constexpr uint16_t kRealNameStart = 0xA000; constexpr uint16_t kRealNameEnd = 0xDFFF; diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 8e3e17b3a11f..46f52224cefd 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -232,7 +232,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) const auto* rideEntry2 = GetRideEntryByIndex(i); if (rideEntry2 != nullptr) { - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry2->ride_type[j] == base_ride_type) { @@ -728,7 +728,7 @@ StringId ResearchItem::GetName() const const auto* rideEntry = GetRideEntryByIndex(entryIndex); if (rideEntry == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return rideEntry->naming.Name; @@ -737,7 +737,7 @@ StringId ResearchItem::GetName() const const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); if (sceneryEntry == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return sceneryEntry->name; @@ -848,7 +848,7 @@ static void ResearchAddAllMissingItems(bool isResearched) const auto* rideEntry = GetRideEntryByIndex(i); if (rideEntry != nullptr) { - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (seenBaseEntry[rideEntry->ride_type[j]]) { @@ -875,7 +875,7 @@ static void ResearchAddAllMissingItems(bool isResearched) if (rideEntry != nullptr) { bool baseSeen = false; - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (seenBaseEntry[rideEntry->ride_type[j]]) { diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 927cdba6b381..7a736e0f1521 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -52,7 +52,7 @@ using namespace OpenRCT2; constexpr uint8_t kNetworkStreamVersion = 4; -const std::string kNetworkStreamID = std::string(OPENRCT2_VERSION) + "-" + std::to_string(kNetworkStreamVersion); +const std::string kNetworkStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kNetworkStreamVersion); static Peep* _pickup_peep = nullptr; static int32_t _pickup_peep_old_x = kLocationNull; @@ -616,7 +616,7 @@ void NetworkBase::UpdateClient() Close(); ContextForceCloseWindowByClass(WindowClass::NetworkStatus); - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, kStringIdNone, {}); break; } } @@ -3578,23 +3578,23 @@ GameActions::Result NetworkSetPlayerGroup( NetworkGroup* fromgroup = network.GetGroupByID(actionPlayerId); if (player == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (network.GetGroupByID(groupId) == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, STR_NONE); + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, kStringIdNone); } if (groupId == 0 && fromgroup != nullptr && fromgroup->Id != 0) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) @@ -3642,7 +3642,7 @@ GameActions::Result NetworkModifyGroups( NetworkGroup* newgroup = network.AddGroup(); if (newgroup == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_DO_THIS, kStringIdNone); } } } @@ -3651,14 +3651,14 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { - return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } for (const auto& it : network.player_list) { if ((it.get())->Group == groupId) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, STR_NONE); + GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, kStringIdNone); } } if (isExecuting) @@ -3671,7 +3671,7 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { // can't change admin group permissions - return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } NetworkGroup* mygroup = nullptr; NetworkPlayer* player = network.GetPlayerByID(actionPlayerId); @@ -3682,7 +3682,8 @@ GameActions::Result NetworkModifyGroups( if (mygroup == nullptr || !mygroup->CanPerformAction(networkPermission)) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, STR_NONE); + GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, + kStringIdNone); } } if (isExecuting) @@ -3717,7 +3718,7 @@ GameActions::Result NetworkModifyGroups( NetworkGroup* group = network.GetGroupByID(groupId); if (group == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, kStringIdNone); } const char* oldName = group->GetName().c_str(); @@ -3746,7 +3747,7 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) { @@ -3778,7 +3779,7 @@ GameActions::Result NetworkKickPlayer(NetworkPlayerId_t playerId, bool isExecuti if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, kStringIdNone); } if (isExecuting) @@ -3814,7 +3815,7 @@ StringId NetworkGetActionNameStringID(uint32_t index) return NetworkActions::Actions[index].Name; } - return STR_NONE; + return kStringIdNone; } int32_t NetworkCanPerformAction(uint32_t groupindex, NetworkPermission index) diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index e1a79de64335..acab82bdea2d 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -71,7 +71,7 @@ void EntranceObject::ReadJson(IReadObjectContext* context, json_t& root) ImageIndex EntranceObject::GetImage(uint8_t sequence, Direction direction) const { if (sequence > 2) - return ImageIndexUndefined; + return kImageIndexUndefined; return _legacyType.image_id + ((direction & 3) * 3) + sequence; } diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index a143dff6ea51..351a38391a3f 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -53,7 +53,7 @@ void FootpathRailingsObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int3 { auto x = width / 2; auto y = height / 2; - auto helper = ImageId(ImageIndexUndefined); + auto helper = ImageId(kImageIndexUndefined); if (Colour != COLOUR_NULL) helper = helper.WithPrimary(Colour); diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 9299a6c7090a..036370c03024 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -209,7 +209,7 @@ std::string Object::GetName(int32_t language) const ImageIndex Object::LoadImages() { - if (_baseImageId == ImageIndexUndefined) + if (_baseImageId == kImageIndexUndefined) { _baseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount()); } @@ -218,10 +218,10 @@ ImageIndex Object::LoadImages() void Object::UnloadImages() { - if (_baseImageId != ImageIndexUndefined) + if (_baseImageId != kImageIndexUndefined) { GfxObjectFreeImages(_baseImageId, GetImageTable().GetCount()); - _baseImageId = ImageIndexUndefined; + _baseImageId = kImageIndexUndefined; } } diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 5a2871710be4..5c13fccefc7d 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -196,7 +196,7 @@ class Object ObjectGeneration _generation{}; bool _usesFallbackImages{}; bool _isCompatibilityObject{}; - ImageIndex _baseImageId{ ImageIndexUndefined }; + ImageIndex _baseImageId{ kImageIndexUndefined }; protected: StringTable& GetStringTable() diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 484b2c52ee0e..4251fb4096c5 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -52,8 +52,8 @@ struct ObjectRepositoryItem struct { uint8_t RideFlags; - uint8_t RideCategory[OpenRCT2::RCT2::ObjectLimits::MaxCategoriesPerRide]; - ride_type_t RideType[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + uint8_t RideCategory[OpenRCT2::RCT2::ObjectLimits::kMaxCategoriesPerRide]; + ride_type_t RideType[OpenRCT2::RCT2::ObjectLimits::kMaxRideTypesPerRideEntry]; } RideInfo; struct { diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 3c2fc8eb2120..d370f5f603da 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -119,7 +119,7 @@ static constexpr SpritePrecision PrecisionFromNumFrames(uint32_t numRotationFram static void RideObjectUpdateRideType(RideObjectEntry& rideEntry) { - for (auto i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto oldRideType = rideEntry.ride_type[i]; if (oldRideType != RIDE_TYPE_NULL) @@ -202,7 +202,7 @@ void RideObject::ReadLegacy(IReadObjectContext* context, IStream* stream) } // Read peep loading positions - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCarTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCarTypesPerRideEntry; i++) { _peepLoadingWaypoints[i].clear(); _peepLoadingPositions[i].clear(); @@ -274,8 +274,8 @@ void RideObject::Load() _legacyType.images_offset = LoadImages(); _legacyType.vehicle_preset_list = &_presetColours; - int32_t currentCarImagesOffset = _legacyType.images_offset + RCT2::ObjectLimits::MaxRideTypesPerRideEntry; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCarTypesPerRideEntry; i++) + int32_t currentCarImagesOffset = _legacyType.images_offset + RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCarTypesPerRideEntry; i++) { CarEntry& carEntry = _legacyType.Cars[i]; if (carEntry.GroupEnabled(SpriteGroupType::SlopeFlat)) @@ -378,7 +378,7 @@ ImageIndex RideObject::GetPreviewImage(ride_type_t type) auto it = std::find(std::begin(_legacyType.ride_type), std::end(_legacyType.ride_type), type); if (it == std::end(_legacyType.ride_type)) { - return ImageIndexUndefined; + return kImageIndexUndefined; } return _legacyType.images_offset + std::distance(std::begin(_legacyType.ride_type), it); @@ -390,11 +390,11 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const auto firstRideType = _legacyType.GetFirstNonNullRideType(); uint8_t category = GetRideTypeDescriptor(firstRideType).Category; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { item->RideInfo.RideType[i] = _legacyType.ride_type[i]; } - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCategoriesPerRide; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCategoriesPerRide; i++) { item->RideInfo.RideCategory[i] = category; } @@ -526,7 +526,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) json_t rideTypes = Json::AsArray(properties["type"]); size_t numRideTypes = rideTypes.size(); - for (size_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (size_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto rideType = RIDE_TYPE_NULL; @@ -572,7 +572,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) // Shop item auto rideSells = Json::AsArray(properties["sells"]); - auto numShopItems = std::min(static_cast(RCT2::ObjectLimits::MaxShopItemsPerRideEntry), rideSells.size()); + auto numShopItems = std::min(static_cast(RCT2::ObjectLimits::kMaxShopItemsPerRideEntry), rideSells.size()); for (size_t i = 0; i < numShopItems; i++) { auto shopItem = ParseShopItem(Json::GetString(rideSells[i])); diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index aae4b3bc3eaa..d2b65812715e 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -22,8 +22,8 @@ class RideObject final : public Object private: RideObjectEntry _legacyType = {}; VehicleColourPresetList _presetColours = {}; - std::vector _peepLoadingPositions[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; - std::vector> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + std::vector _peepLoadingPositions[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; + std::vector> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; public: static constexpr ObjectType kObjectType = ObjectType::Ride; diff --git a/src/openrct2/object/StationObject.cpp b/src/openrct2/object/StationObject.cpp index 428ace48e0d7..e009773f0bdb 100644 --- a/src/openrct2/object/StationObject.cpp +++ b/src/openrct2/object/StationObject.cpp @@ -42,8 +42,8 @@ void StationObject::Unload() UnloadImages(); NameStringId = 0; - BaseImageId = ImageIndexUndefined; - ShelterImageId = ImageIndexUndefined; + BaseImageId = kImageIndexUndefined; + ShelterImageId = kImageIndexUndefined; } void StationObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index 89a97eeb5894..f15d559598b8 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -27,8 +27,8 @@ class StationObject final : public Object static constexpr ObjectType kObjectType = ObjectType::Station; StringId NameStringId{}; - ImageIndex BaseImageId = ImageIndexUndefined; - ImageIndex ShelterImageId = ImageIndexUndefined; + ImageIndex BaseImageId = kImageIndexUndefined; + ImageIndex ShelterImageId = kImageIndexUndefined; uint32_t Flags{}; int32_t Height{}; uint8_t ScrollingMode{}; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 42b87948876e..52f7fcdd412e 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -130,7 +130,7 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 } auto stationObj = ride->GetStationObject(); - if (stationObj == nullptr || stationObj->BaseImageId == ImageIndexUndefined) + if (stationObj == nullptr || stationObj->BaseImageId == kImageIndexUndefined) { return; } diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp index ddf3c65bc13b..943e3c66ca53 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp @@ -43,7 +43,7 @@ static ImageIndex GetFootpathLampImage(const PathAdditionEntry& pathAdditionEntr { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; return pathAdditionEntry.image + offset + (isBroken ? 4 : 0); } @@ -51,7 +51,7 @@ static ImageIndex GetFootpathBinImage(const PathAdditionEntry& pathAdditionEntry { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; auto stateOffset = isBroken ? 4 : (isFull ? 8 : 0); return pathAdditionEntry.image + offset + stateOffset; @@ -61,7 +61,7 @@ static ImageIndex GetFootpathBenchImage(const PathAdditionEntry& pathAdditionEnt { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; return pathAdditionEntry.image + offset + (isBroken ? 4 : 0); } diff --git a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp index 56762e7b8224..4249fea4463c 100644 --- a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp @@ -606,7 +606,7 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( kClassicStandUpRcLeftBankedOrthogonalToDiag2_1, kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 }, { kClassicStandUpRcLeftBankedOrthogonalToDiag0_2, kClassicStandUpRcLeftBankedOrthogonalToDiag1_2, kClassicStandUpRcLeftBankedOrthogonalToDiag2_2, kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcLeftBankedOrthogonalToDiag0_3, kClassicStandUpRcLeftBankedOrthogonalToDiag1_3, kClassicStandUpRcLeftBankedOrthogonalToDiag2_3, kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 }, }; @@ -760,7 +760,7 @@ static void classicStandUpRCTrackRightEighthBankToDiag( kClassicStandUpRcRightBankedOrthogonalToDiag2_1, kClassicStandUpRcRightBankedOrthogonalToDiag3_1 }, { kClassicStandUpRcRightBankedOrthogonalToDiag0_2, kClassicStandUpRcRightBankedOrthogonalToDiag1_2, kClassicStandUpRcRightBankedOrthogonalToDiag2_2, kClassicStandUpRcRightBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcRightBankedOrthogonalToDiag0_3, kClassicStandUpRcRightBankedOrthogonalToDiag1_3, kClassicStandUpRcRightBankedOrthogonalToDiag2_3, kClassicStandUpRcRightBankedOrthogonalToDiag3_3 }, }; @@ -928,7 +928,7 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( static constexpr ImageIndex map[4][kNumOrthogonalDirections] = { { kClassicStandUpRcRightTurn3TilesBanked0_0, kClassicStandUpRcRightTurn3TilesBanked1_0, kClassicStandUpRcRightTurn3TilesBanked2_0, kClassicStandUpRcRightTurn3TilesBanked3_0 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcRightTurn3TilesBanked0_1, kClassicStandUpRcRightTurn3TilesBanked1_1, kClassicStandUpRcRightTurn3TilesBanked2_1, kClassicStandUpRcRightTurn3TilesBanked3_1 }, diff --git a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp index 49da80a587b8..3b4a541df502 100644 --- a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp @@ -233,7 +233,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_FRONT_NW_SE, }, { @@ -241,7 +241,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_SE_NW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_FRONT_SE_NW, }, } }; @@ -255,7 +255,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_RIGHT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_RIGHT_BANK_FRONT_NE_SW, }, { @@ -276,12 +276,12 @@ static constexpr std::array kUp25T }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_FRONT_NE_SW, }, { @@ -295,12 +295,12 @@ static constexpr std::array kUp25T }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_FRONT_NE_SW, }, { @@ -314,12 +314,12 @@ static constexpr std::array kLeftB }, { SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_FRONT_NE_SW, }, { @@ -332,12 +332,12 @@ static constexpr std::array kRight }, { SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_FRONT_NE_SW, }, { @@ -348,7 +348,7 @@ static constexpr std::array kRight static constexpr std::array kDiagFlatToLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_FRONT_0, }, { @@ -356,7 +356,7 @@ static constexpr std::array kDiagF }, { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_FRONT_2, }, { @@ -367,7 +367,7 @@ static constexpr std::array kDiagF static constexpr std::array kDiagFlatToRightBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_FRONT_0, }, { @@ -375,7 +375,7 @@ static constexpr std::array kDiagF }, { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_FRONT_2, }, { @@ -386,7 +386,7 @@ static constexpr std::array kDiagF static constexpr std::array kDiagLeftBankTo25DegUpImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_FRONT_0, }, { @@ -394,7 +394,7 @@ static constexpr std::array kDiagL }, { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_FRONT_2, }, { @@ -405,7 +405,7 @@ static constexpr std::array kDiagL static constexpr std::array kDiagRightBankTo25DegUpImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_FRONT_0, }, { @@ -413,7 +413,7 @@ static constexpr std::array kDiagR }, { SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_FRONT_2, }, { @@ -424,7 +424,7 @@ static constexpr std::array kDiagR static constexpr std::array kDiagUp25ToLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_FRONT_0, }, { @@ -432,7 +432,7 @@ static constexpr std::array kDiagU }, { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_FRONT_2, }, { @@ -443,7 +443,7 @@ static constexpr std::array kDiagU static constexpr std::array kDiagLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_FRONT_0, }, { @@ -451,7 +451,7 @@ static constexpr std::array kDiagL }, { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_FRONT_2, }, { @@ -462,7 +462,7 @@ static constexpr std::array kDiagL static constexpr std::array kDiagUp25ToRightBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_FRONT_0, }, { @@ -470,7 +470,7 @@ static constexpr std::array kDiagU }, { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_FRONT_2, }, { @@ -485,7 +485,7 @@ static constexpr std::array( session, direction, imageIds[direction].track, imageIds[direction].handrail, { 0, 0, height }, { { 0, 3, height }, { 32, 25, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, { 0, 0, height }, @@ -194,7 +194,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -210,7 +210,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -231,7 +231,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -247,7 +247,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -268,7 +268,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -284,7 +284,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -323,7 +323,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -339,7 +339,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -360,7 +360,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -376,7 +376,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -397,7 +397,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -413,7 +413,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -434,7 +434,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -450,7 +450,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -471,7 +471,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 32, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -487,7 +487,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -549,7 +549,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -569,7 +569,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -635,7 +635,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -651,7 +651,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -683,7 +683,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -703,7 +703,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -747,7 +747,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][3].track, imageIds[0][3].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][3].frontTrack != ImageIndexUndefined) + if (imageIds[0][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][3].frontTrack, imageIds[0][3].frontHandrail, { 0, 0, height }, @@ -767,7 +767,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][1].track, imageIds[0][1].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][1].frontTrack != ImageIndexUndefined) + if (imageIds[0][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][1].frontTrack, imageIds[0][1].frontHandrail, { 0, 0, height }, @@ -840,7 +840,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][3].track, imageIds[1][3].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][3].frontTrack != ImageIndexUndefined) + if (imageIds[1][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][3].frontTrack, imageIds[1][3].frontHandrail, { 0, 0, height }, @@ -856,7 +856,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][1].track, imageIds[1][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][1].frontTrack != ImageIndexUndefined) + if (imageIds[1][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][1].frontTrack, imageIds[1][1].frontHandrail, { 0, 0, height }, @@ -886,7 +886,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][3].track, imageIds[2][3].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[2][3].frontTrack != ImageIndexUndefined) + if (imageIds[2][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][3].frontTrack, imageIds[2][3].frontHandrail, { 0, 0, height }, @@ -906,7 +906,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][1].track, imageIds[2][1].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[2][1].frontTrack != ImageIndexUndefined) + if (imageIds[2][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][1].frontTrack, imageIds[2][1].frontHandrail, { 0, 0, height }, @@ -963,7 +963,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -983,7 +983,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1051,7 +1051,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1067,7 +1067,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1097,7 +1097,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1117,7 +1117,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1175,7 +1175,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][2].track, imageIds[0][2].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][2].frontTrack != ImageIndexUndefined) + if (imageIds[0][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][2].frontTrack, imageIds[0][2].frontHandrail, { 0, 0, height }, @@ -1195,7 +1195,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][0].track, imageIds[0][0].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][0].frontTrack != ImageIndexUndefined) + if (imageIds[0][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][0].frontTrack, imageIds[0][0].frontHandrail, { 0, 0, height }, @@ -1266,7 +1266,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][2].track, imageIds[1][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][2].frontTrack != ImageIndexUndefined) + if (imageIds[1][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][2].frontTrack, imageIds[1][2].frontHandrail, { 0, 0, height }, @@ -1282,7 +1282,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][0].track, imageIds[1][0].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][0].frontTrack != ImageIndexUndefined) + if (imageIds[1][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][0].frontTrack, imageIds[1][0].frontHandrail, { 0, 0, height }, @@ -1314,7 +1314,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][2].track, imageIds[2][2].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[2][2].frontTrack != ImageIndexUndefined) + if (imageIds[2][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][2].frontTrack, imageIds[2][2].frontHandrail, { 0, 0, height }, @@ -1334,7 +1334,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][0].track, imageIds[2][0].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[2][0].frontTrack != ImageIndexUndefined) + if (imageIds[2][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][0].frontTrack, imageIds[2][0].frontHandrail, { 0, 0, height }, @@ -1391,7 +1391,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1411,7 +1411,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1466,7 +1466,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1486,7 +1486,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1520,7 +1520,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1540,7 +1540,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1591,7 +1591,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -1611,7 +1611,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -1645,7 +1645,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -1665,7 +1665,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -1709,7 +1709,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][3].track, imageIds[0][3].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][3].frontTrack != ImageIndexUndefined) + if (imageIds[0][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][3].frontTrack, imageIds[0][3].frontHandrail, { 0, 0, height }, @@ -1729,7 +1729,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][1].track, imageIds[0][1].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[0][1].frontTrack != ImageIndexUndefined) + if (imageIds[0][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][1].frontTrack, imageIds[0][1].frontHandrail, { 0, 0, height }, @@ -1788,7 +1788,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][3].track, imageIds[1][3].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][3].frontTrack != ImageIndexUndefined) + if (imageIds[1][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][3].frontTrack, imageIds[1][3].frontHandrail, { 0, 0, height }, @@ -1808,7 +1808,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][1].track, imageIds[1][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][1].frontTrack != ImageIndexUndefined) + if (imageIds[1][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][1].frontTrack, imageIds[1][1].frontHandrail, { 0, 0, height }, @@ -1842,7 +1842,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][3].track, imageIds[2][3].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][3].frontTrack != ImageIndexUndefined) + if (imageIds[2][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][3].frontTrack, imageIds[2][3].frontHandrail, { 0, 0, height }, @@ -1862,7 +1862,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][1].track, imageIds[2][1].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][1].frontTrack != ImageIndexUndefined) + if (imageIds[2][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][1].frontTrack, imageIds[2][1].frontHandrail, { 0, 0, height }, @@ -1911,7 +1911,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][3].track, imageIds[3][3].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[3][3].frontTrack != ImageIndexUndefined) + if (imageIds[3][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][3].frontTrack, imageIds[3][3].frontHandrail, { 0, 0, height }, @@ -1931,7 +1931,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][1].track, imageIds[3][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[3][1].frontTrack != ImageIndexUndefined) + if (imageIds[3][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][1].frontTrack, imageIds[3][1].frontHandrail, { 0, 0, height }, @@ -1965,7 +1965,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][3].track, imageIds[4][3].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[4][3].frontTrack != ImageIndexUndefined) + if (imageIds[4][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][3].frontTrack, imageIds[4][3].frontHandrail, { 0, 0, height }, @@ -1985,7 +1985,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][1].track, imageIds[4][1].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[4][1].frontTrack != ImageIndexUndefined) + if (imageIds[4][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][1].frontTrack, imageIds[4][1].frontHandrail, { 0, 0, height }, @@ -2042,7 +2042,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2062,7 +2062,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2116,7 +2116,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2136,7 +2136,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2170,7 +2170,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -2190,7 +2190,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -2239,7 +2239,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -2259,7 +2259,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -2293,7 +2293,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -2313,7 +2313,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -2371,7 +2371,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][2].track, imageIds[0][2].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[0][2].frontTrack != ImageIndexUndefined) + if (imageIds[0][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][2].frontTrack, imageIds[0][2].frontHandrail, { 0, 0, height }, @@ -2391,7 +2391,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][0].track, imageIds[0][0].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][0].frontTrack != ImageIndexUndefined) + if (imageIds[0][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][0].frontTrack, imageIds[0][0].frontHandrail, { 0, 0, height }, @@ -2451,7 +2451,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][2].track, imageIds[1][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][2].frontTrack != ImageIndexUndefined) + if (imageIds[1][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][2].frontTrack, imageIds[1][2].frontHandrail, { 0, 0, height }, @@ -2471,7 +2471,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][0].track, imageIds[1][0].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][0].frontTrack != ImageIndexUndefined) + if (imageIds[1][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][0].frontTrack, imageIds[1][0].frontHandrail, { 0, 0, height }, @@ -2505,7 +2505,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][2].track, imageIds[2][2].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][2].frontTrack != ImageIndexUndefined) + if (imageIds[2][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][2].frontTrack, imageIds[2][2].frontHandrail, { 0, 0, height }, @@ -2525,7 +2525,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][0].track, imageIds[2][0].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][0].frontTrack != ImageIndexUndefined) + if (imageIds[2][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][0].frontTrack, imageIds[2][0].frontHandrail, { 0, 0, height }, @@ -2576,7 +2576,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][2].track, imageIds[3][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[3][2].frontTrack != ImageIndexUndefined) + if (imageIds[3][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][2].frontTrack, imageIds[3][2].frontHandrail, { 0, 0, height }, @@ -2596,7 +2596,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][0].track, imageIds[3][0].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[3][0].frontTrack != ImageIndexUndefined) + if (imageIds[3][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][0].frontTrack, imageIds[3][0].frontHandrail, { 0, 0, height }, @@ -2630,7 +2630,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][2].track, imageIds[4][2].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[4][2].frontTrack != ImageIndexUndefined) + if (imageIds[4][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][2].frontTrack, imageIds[4][2].frontHandrail, { 0, 0, height }, @@ -2650,7 +2650,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][0].track, imageIds[4][0].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[4][0].frontTrack != ImageIndexUndefined) + if (imageIds[4][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][0].frontTrack, imageIds[4][0].frontHandrail, { 0, 0, height }, @@ -2707,7 +2707,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2727,7 +2727,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2772,7 +2772,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2785,7 +2785,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2798,7 +2798,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2838,7 +2838,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2858,7 +2858,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2903,7 +2903,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2916,7 +2916,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2929,7 +2929,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2986,7 +2986,7 @@ static void WoodenRCTrackDiagFlatToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3002,7 +3002,7 @@ static void WoodenRCTrackDiagFlatToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3054,7 +3054,7 @@ static void WoodenRCTrackDiagBankTo25DegUp( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3070,7 +3070,7 @@ static void WoodenRCTrackDiagBankTo25DegUp( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3122,7 +3122,7 @@ static void WoodenRCTrackDiagUp25ToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3138,7 +3138,7 @@ static void WoodenRCTrackDiagUp25ToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3190,7 +3190,7 @@ static void WoodenRCTrackDiagLeftBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3206,7 +3206,7 @@ static void WoodenRCTrackDiagLeftBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3253,7 +3253,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3269,7 +3269,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3294,7 +3294,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 34, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3310,7 +3310,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3331,7 +3331,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3347,7 +3347,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3368,7 +3368,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 16, 18, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3384,7 +3384,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 16, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3416,7 +3416,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3432,7 +3432,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3457,7 +3457,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3473,7 +3473,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 34, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3494,7 +3494,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3510,7 +3510,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 4, 4, height }, { 28, 28, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3531,7 +3531,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 16, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3547,7 +3547,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 16, 18, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, diff --git a/src/openrct2/paint/vehicle/VehiclePaint.cpp b/src/openrct2/paint/vehicle/VehiclePaint.cpp index 953b8da2862b..a85c51f1cb88 100644 --- a/src/openrct2/paint/vehicle/VehiclePaint.cpp +++ b/src/openrct2/paint/vehicle/VehiclePaint.cpp @@ -4301,8 +4301,8 @@ void VehicleVisualDefault( if (vehicle->HasFlag(VehicleFlags::CarIsReversed)) { auto imagePitch = PitchInvertTable[vehicle->Pitch]; - auto imageYaw = (imageDirection + (OpenRCT2::Entity::Yaw::BaseRotation / 2)) - & (OpenRCT2::Entity::Yaw::BaseRotation - 1); + auto imageYaw = (imageDirection + (OpenRCT2::Entity::Yaw::kBaseRotation / 2)) + & (OpenRCT2::Entity::Yaw::kBaseRotation - 1); PaintFunctionsByPitch[imagePitch](session, vehicle, imageYaw, z, carEntry); } else diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index b6df72a670e8..661d86b6e7e8 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -117,7 +117,7 @@ namespace OpenRCT2 void ThrowIfIncompatibleVersion() { const auto& header = _os->GetHeader(); - if (/*header.TargetVersion < PARK_FILE_MIN_SUPPORTED_VERSION || */ header.MinVersion > PARK_FILE_CURRENT_VERSION) + if (/*header.TargetVersion < kParkFileMinSupportedVersion || */ header.MinVersion > kParkFileCurrentVersion) { throw UnsupportedVersionException(header.MinVersion, header.TargetVersion); } @@ -129,7 +129,7 @@ namespace OpenRCT2 const auto& header = _os->GetHeader(); minVersion = header.MinVersion; targetVersion = header.TargetVersion; - return targetVersion > PARK_FILE_CURRENT_VERSION; + return targetVersion > kParkFileCurrentVersion; } void Load(const std::string_view path) @@ -179,9 +179,9 @@ namespace OpenRCT2 OrcaStream os(stream, OrcaStream::Mode::WRITING); auto& header = os.GetHeader(); - header.Magic = PARK_FILE_MAGIC; - header.TargetVersion = PARK_FILE_CURRENT_VERSION; - header.MinVersion = PARK_FILE_MIN_VERSION; + header.Magic = kParkFileMagic; + header.TargetVersion = kParkFileCurrentVersion; + header.MinVersion = kParkFileMinVersion; ReadWriteAuthoringChunk(os); ReadWriteObjectsChunk(os); @@ -1924,7 +1924,7 @@ namespace OpenRCT2 cs.ReadWrite(item); if (item == 255) { - thought.item = PeepThoughtItemNone; + thought.item = kPeepThoughtItemNone; } else { diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index e4ed437652b0..0d4fafcf72e0 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -11,16 +11,16 @@ namespace OpenRCT2 struct GameState_t; // Current version that is saved. - constexpr uint32_t PARK_FILE_CURRENT_VERSION = 50; + constexpr uint32_t kParkFileCurrentVersion = 50; // The minimum version that is forwards compatible with the current version. - constexpr uint32_t PARK_FILE_MIN_VERSION = 50; + constexpr uint32_t kParkFileMinVersion = 50; // The minimum version that is backwards compatible with the current version. // If this is increased beyond 0, uncomment the checks in ParkFile.cpp and Context.cpp! - constexpr uint32_t PARK_FILE_MIN_SUPPORTED_VERSION = 0x0; + constexpr uint32_t kParkFileMinSupportedVersion = 0x0; - constexpr uint32_t PARK_FILE_MAGIC = 0x4B524150; // PARK + constexpr uint32_t kParkFileMagic = 0x4B524150; // PARK struct IStream; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index d243574cd732..cce333e31a40 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -467,7 +467,7 @@ namespace OpenRCT2::PathFinding edges &= ~(1 << DirectionReverse(chosenDirection)); loc.z = tileElement->BaseHeight; - for (Direction dir : ALL_DIRECTIONS) + for (Direction dir : kAllDirections) { if (!(edges & (1 << dir))) continue; @@ -1911,7 +1911,7 @@ namespace OpenRCT2::PathFinding /* If this tileElement is adjacent to any non-wide paths, * remove all of the edges to wide paths. */ uint8_t adjustedEdges = edges; - for (Direction chosenDirection : ALL_DIRECTIONS) + for (Direction chosenDirection : kAllDirections) { // If there is no path in that direction try another if (!(adjustedEdges & (1 << chosenDirection))) @@ -1981,7 +1981,7 @@ namespace OpenRCT2::PathFinding if (!peep.HasFoodOrDrink() && (ScenarioRand() & 0xFFFF) >= 2184) { uint8_t adjustedEdges = edges; - for (Direction chosenDirection : ALL_DIRECTIONS) + for (Direction chosenDirection : kAllDirections) { // If there is no path in that direction try another if (!(adjustedEdges & (1 << chosenDirection))) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index b808612d1558..2b4d67fc133b 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -169,7 +169,7 @@ static bool OnCrash( wprintf(L"Dump Path: %s\n", dumpPath); wprintf(L"Dump File Path: %s\n", dumpFilePath); wprintf(L"Dump Id: %s\n", miniDumpId); - wprintf(L"Version: %s\n", WSZ(OPENRCT2_VERSION)); + wprintf(L"Version: %s\n", WSZ(kOpenRCT2Version)); wprintf(L"Commit: %s\n", _wszCommitSha1Short); bool savedGameDumped = false; @@ -253,7 +253,7 @@ static bool OnCrash( L"We would like to upload the crash dump for automated analysis, do you agree?\n" L"The automated analysis is done by courtesy of https://backtrace.io/"; wchar_t message[MAX_PATH * 2]; - swprintf_s(message, MessageFormat, dumpFilePath, WSZ(OPENRCT2_VERSION), _wszCommitSha1Short); + swprintf_s(message, MessageFormat, dumpFilePath, WSZ(kOpenRCT2Version), _wszCommitSha1Short); // Cannot use platform_show_messagebox here, it tries to set parent window already dead. int answer = MessageBoxW(nullptr, message, WSZ(OPENRCT2_NAME), MB_YESNO | MB_ICONERROR); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 34be3cf4f9f4..bea9e9f18adf 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2920,7 +2920,7 @@ namespace OpenRCT2::RCT1 auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->Type); if (srcThought->Item == RCT12PeepThoughtItemNone) - dstThought->item = PeepThoughtItemNone; + dstThought->item = kPeepThoughtItemNone; else dstThought->item = srcThought->Item; dstThought->freshness = srcThought->Freshness; diff --git a/src/openrct2/rct2/DATLimits.h b/src/openrct2/rct2/DATLimits.h index 77535577624f..06c9dda639c0 100644 --- a/src/openrct2/rct2/DATLimits.h +++ b/src/openrct2/rct2/DATLimits.h @@ -12,10 +12,10 @@ namespace OpenRCT2::RCT2::ObjectLimits { - constexpr uint8_t MaxCategoriesPerRide = 2; - constexpr uint8_t MaxRideTypesPerRideEntry = 3; + constexpr uint8_t kMaxCategoriesPerRide = 2; + constexpr uint8_t kMaxRideTypesPerRideEntry = 3; // The max number of different types of car. // Examples of cars here are the locomotive, tender and carriage of the Miniature Railway. - constexpr uint8_t MaxCarTypesPerRideEntry = 4; - constexpr uint8_t MaxShopItemsPerRideEntry = 2; + constexpr uint8_t kMaxCarTypesPerRideEntry = 4; + constexpr uint8_t kMaxShopItemsPerRideEntry = 2; } // namespace OpenRCT2::RCT2::ObjectLimits diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index d4cdd8cb63fd..bbe8ce81c876 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -26,10 +26,10 @@ enum class VehicleColourSettings : uint8_t; namespace OpenRCT2::RCT2 { - constexpr StringId RCT2_RIDE_STRING_START = 2; + constexpr StringId kRCT2RideStringStart = 2; // clang-format off - constexpr uint16_t RCT2_OBJECT_ENTRY_COUNT = + constexpr uint16_t kRCT2ObjectEntryCount = Limits::kMaxRideObjects + Limits::kMaxSmallSceneryObjects + Limits::kMaxLargeSceneryObjects + @@ -42,10 +42,10 @@ namespace OpenRCT2::RCT2 Limits::kMaxWaterObjects + Limits::kMaxScenarioTextObjects; // clang-format on - static_assert(RCT2_OBJECT_ENTRY_COUNT == 721); + static_assert(kRCT2ObjectEntryCount == 721); // clang-format off - constexpr int32_t RCT2ObjectEntryGroupCounts[] = { + constexpr int32_t kRCT2ObjectEntryGroupCounts[] = { Limits::kMaxRideObjects, Limits::kMaxSmallSceneryObjects, Limits::kMaxLargeSceneryObjects, @@ -784,7 +784,7 @@ namespace OpenRCT2::RCT2 // SC6[3] union { - RCTObjectEntry Objects[RCT2_OBJECT_ENTRY_COUNT]; + RCTObjectEntry Objects[kRCT2ObjectEntryCount]; struct { RCTObjectEntry RideObjects[Limits::kMaxRideObjects]; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 3f3b960d8aae..6097ad1b3a8a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -450,7 +450,7 @@ namespace OpenRCT2::RCT2 // In RCT2, the ride string IDs start at index STR_0002 and are directly mappable. // This is not always the case in OpenRCT2, so we use the actual ride ID. if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) - gameState.ScenarioObjective.RideId = _s6.ObjectiveGuests - RCT2_RIDE_STRING_START; + gameState.ScenarioObjective.RideId = _s6.ObjectiveGuests - kRCT2RideStringStart; else gameState.ScenarioObjective.NumGuests = _s6.ObjectiveGuests; ImportMarketingCampaigns(); @@ -1809,7 +1809,7 @@ namespace OpenRCT2::RCT2 ObjectEntryIndex railingCount = 0; for (int16_t objectType = EnumValue(ObjectType::Ride); objectType <= EnumValue(ObjectType::Water); objectType++) { - for (int16_t i = 0; i < RCT2ObjectEntryGroupCounts[objectType]; i++, objectIt++) + for (int16_t i = 0; i < kRCT2ObjectEntryGroupCounts[objectType]; i++, objectIt++) { auto entry = ObjectEntryDescriptor(_s6.Objects[objectIt]); if (entry.HasValue()) @@ -2081,7 +2081,7 @@ namespace OpenRCT2::RCT2 auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->Type); if (srcThought->Item == RCT12PeepThoughtItemNone) - dstThought->item = PeepThoughtItemNone; + dstThought->item = kPeepThoughtItemNone; else dstThought->item = srcThought->Item; dstThought->freshness = srcThought->Freshness; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 86a2a351bd80..7ac809134afa 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -117,7 +117,7 @@ static Ride _previewRide{}; struct StationIndexWithMessage { ::StationIndex StationIndex; - StringId Message = STR_NONE; + StringId Message = kStringIdNone; }; // Static function declarations @@ -852,7 +852,7 @@ void Ride::FormatStatusTo(Formatter& ft) const else { ft.Add(STR_RACE_WON_BY); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } else if (!GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) @@ -997,13 +997,13 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons { if (!(lifecycle_flags & RIDE_LIFECYCLE_TESTED)) { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return nullptr; } if (!RideHasRatings(*this)) { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return nullptr; } @@ -1016,7 +1016,7 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons } if (errMessage.HasMessage()) { - ContextShowError(errMessage.Message, STR_EMPTY, {}); + ContextShowError(errMessage.Message, kStringIdEmpty, {}); } return td; @@ -2157,7 +2157,7 @@ std::pair Ride::GetMeasurement() measurement->last_use_tick = GetGameState().CurrentTicks; if (measurement->flags & 1) { - return { measurement.get(), { STR_EMPTY, {} } }; + return { measurement.get(), { kStringIdEmpty, {} } }; } auto ft = Formatter(); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 25875015069d..45465e7e3e7f 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -201,7 +201,7 @@ struct Ride uint16_t num_customers_timeout{}; // Customer count in the last 10 * 960 game ticks (sliding window) uint16_t num_customers[OpenRCT2::Limits::kCustomerHistorySize]{}; - money64 price[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 price[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]{}; TileCoordsXYZ ChairliftBullwheelLocation[2]; RatingTuple ratings{}; money64 value{}; diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 28cfb166ad28..d82ea4b07ad0 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -297,7 +297,7 @@ struct TrackDrawerEntry RideTrackGroups extraTrackGroups{}; ImageIndex icon = kSpriteIdNull; - StringId tooltip = STR_NONE; + StringId tooltip = kStringIdNone; void GetAvailableTrackGroups(RideTrackGroups& res) const; bool SupportsTrackGroup(const TrackGroup trackGroup) const; @@ -491,7 +491,7 @@ struct RideTypeDescriptor UpkeepCostsDescriptor UpkeepCosts{}; // rct2: 0x0097DD78 RideBuildCost BuildCosts{}; - money64 DefaultPrices[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 DefaultPrices[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]{}; std::string_view DefaultMusic{}; /** rct2: 0x0097D7CB */ ShopItemIndex PhotoItem{}; diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index 4e2725690410..c8787a0a782d 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -49,7 +49,7 @@ struct RideObjectEntry // The first three images are previews. They correspond to the ride_type[] array. uint32_t images_offset; uint32_t flags; - ride_type_t ride_type[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + ride_type_t ride_type[OpenRCT2::RCT2::ObjectLimits::kMaxRideTypesPerRideEntry]; uint8_t min_cars_in_train; uint8_t max_cars_in_train; uint8_t cars_per_flat_ride; @@ -64,13 +64,13 @@ struct RideObjectEntry uint8_t RearCar; uint8_t ThirdCar; uint8_t BuildMenuPriority; - CarEntry Cars[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + CarEntry Cars[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; VehicleColourPresetList* vehicle_preset_list; int8_t excitement_multiplier; int8_t intensity_multiplier; int8_t nausea_multiplier; uint8_t max_height; - ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; + ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]; StringId capacity; uint8_t Clearance; diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index f344ef1cd6d6..dde6a07ec169 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -55,10 +55,10 @@ constexpr ShopItemDescriptor ShopItems[EnumValue(ShopItem::Count)] = { /* ShopItem::Lemonade */ { 0.40_GBP, 1.10_GBP, 2.10_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_LEMONADE, { STR_SHOP_ITEM_PRICE_LABEL_LEMONADE, STR_SHOP_ITEM_SINGULAR_LEMONADE, STR_SHOP_ITEM_PLURAL_LEMONADE, STR_SHOP_ITEM_INDEFINITE_LEMONADE, STR_SHOP_ITEM_DISPLAY_LEMONADE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::EmptyBottle, 115, ShopItem::EmptyBottle, PeepThoughtType::LemonadeMuch, PeepThoughtType::Lemonade }, /* ShopItem::EmptyBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBox, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, /* ShopItem::EmptyBottle */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOTTLE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOTTLE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOTTLE, STR_SHOP_ITEM_PLURAL_EMPTY_BOTTLE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOTTLE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOTTLE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBottle, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::Admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, /* ShopItem::Photo2 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO2, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo2Much, PeepThoughtType::Photo2 }, /* ShopItem::Photo3 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO3, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo3Much, PeepThoughtType::Photo3 }, /* ShopItem::Photo4 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO4, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo4Much, PeepThoughtType::Photo4 }, diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index a20fd4d171b6..70c36a5550d6 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4479,58 +4479,58 @@ namespace OpenRCT2::TrackMetaData } static constexpr StringId RideConfigurationStringIds[] = { - STR_EMPTY, // 0 + kStringIdEmpty, // 0 STR_STATION_PLATFORM, // 1 - STR_EMPTY, // 2 - STR_EMPTY, // 3 - STR_EMPTY, // 4 - STR_EMPTY, // 5 - STR_EMPTY, // 6 - STR_EMPTY, // 7 - STR_EMPTY, // 8 - STR_EMPTY, // 9 - STR_EMPTY, // 10 - STR_EMPTY, // 11 - STR_EMPTY, // 12 - STR_EMPTY, // 13 - STR_EMPTY, // 14 - STR_EMPTY, // 15 - STR_EMPTY, // 16 - STR_EMPTY, // 17 - STR_EMPTY, // 18 - STR_EMPTY, // 19 - STR_EMPTY, // 20 - STR_EMPTY, // 21 - STR_EMPTY, // 22 - STR_EMPTY, // 23 - STR_EMPTY, // 24 - STR_EMPTY, // 25 - STR_EMPTY, // 26 - STR_EMPTY, // 27 - STR_EMPTY, // 28 - STR_EMPTY, // 29 - STR_EMPTY, // 30 - STR_EMPTY, // 31 - STR_EMPTY, // 32 - STR_EMPTY, // 33 - STR_EMPTY, // 34 - STR_EMPTY, // 35 - STR_EMPTY, // 36 - STR_EMPTY, // 37 + kStringIdEmpty, // 2 + kStringIdEmpty, // 3 + kStringIdEmpty, // 4 + kStringIdEmpty, // 5 + kStringIdEmpty, // 6 + kStringIdEmpty, // 7 + kStringIdEmpty, // 8 + kStringIdEmpty, // 9 + kStringIdEmpty, // 10 + kStringIdEmpty, // 11 + kStringIdEmpty, // 12 + kStringIdEmpty, // 13 + kStringIdEmpty, // 14 + kStringIdEmpty, // 15 + kStringIdEmpty, // 16 + kStringIdEmpty, // 17 + kStringIdEmpty, // 18 + kStringIdEmpty, // 19 + kStringIdEmpty, // 20 + kStringIdEmpty, // 21 + kStringIdEmpty, // 22 + kStringIdEmpty, // 23 + kStringIdEmpty, // 24 + kStringIdEmpty, // 25 + kStringIdEmpty, // 26 + kStringIdEmpty, // 27 + kStringIdEmpty, // 28 + kStringIdEmpty, // 29 + kStringIdEmpty, // 30 + kStringIdEmpty, // 31 + kStringIdEmpty, // 32 + kStringIdEmpty, // 33 + kStringIdEmpty, // 34 + kStringIdEmpty, // 35 + kStringIdEmpty, // 36 + kStringIdEmpty, // 37 STR_S_BEND_LEFT, // 38 STR_S_BEND_RIGHT, // 39 STR_VERTICAL_LOOP_LEFT, // 40 STR_VERTICAL_LOOP_RIGHT, // 41 - STR_EMPTY, // 42 - STR_EMPTY, // 43 - STR_EMPTY, // 44 - STR_EMPTY, // 45 - STR_EMPTY, // 46 - STR_EMPTY, // 47 - STR_EMPTY, // 48 - STR_EMPTY, // 49 - STR_EMPTY, // 50 - STR_EMPTY, // 51 + kStringIdEmpty, // 42 + kStringIdEmpty, // 43 + kStringIdEmpty, // 44 + kStringIdEmpty, // 45 + kStringIdEmpty, // 46 + kStringIdEmpty, // 47 + kStringIdEmpty, // 48 + kStringIdEmpty, // 49 + kStringIdEmpty, // 50 + kStringIdEmpty, // 51 STR_IN_LINE_TWIST_LEFT, // 52 STR_IN_LINE_TWIST_RIGHT, // 53 STR_IN_LINE_TWIST_LEFT, // 54 @@ -4541,31 +4541,31 @@ namespace OpenRCT2::TrackMetaData STR_HALF_CORKSCREW_RIGHT, // 59 STR_HALF_CORKSCREW_LEFT, // 60 STR_HALF_CORKSCREW_RIGHT, // 61 - STR_EMPTY, // 62 - STR_EMPTY, // 63 - STR_EMPTY, // 64 - STR_EMPTY, // 65 + kStringIdEmpty, // 62 + kStringIdEmpty, // 63 + kStringIdEmpty, // 64 + kStringIdEmpty, // 65 STR_ENTRY_EXIT_PLATFORM, // 66 STR_VERTICAL_TOWER, // 67 - STR_EMPTY, // 68 - STR_EMPTY, // 69 - STR_EMPTY, // 70 - STR_EMPTY, // 71 - STR_EMPTY, // 72 - STR_EMPTY, // 73 - STR_EMPTY, // 74 - STR_EMPTY, // 75 - STR_EMPTY, // 76 - STR_EMPTY, // 77 - STR_EMPTY, // 78 - STR_EMPTY, // 79 - STR_EMPTY, // 80 - STR_EMPTY, // 81 - STR_EMPTY, // 82 + kStringIdEmpty, // 68 + kStringIdEmpty, // 69 + kStringIdEmpty, // 70 + kStringIdEmpty, // 71 + kStringIdEmpty, // 72 + kStringIdEmpty, // 73 + kStringIdEmpty, // 74 + kStringIdEmpty, // 75 + kStringIdEmpty, // 76 + kStringIdEmpty, // 77 + kStringIdEmpty, // 78 + kStringIdEmpty, // 79 + kStringIdEmpty, // 80 + kStringIdEmpty, // 81 + kStringIdEmpty, // 82 STR_S_BEND_LEFT, // 83 STR_S_BEND_RIGHT, // 84 - STR_EMPTY, // 85 - STR_EMPTY, // 86 + kStringIdEmpty, // 85 + kStringIdEmpty, // 86 STR_HELIX_UP_SMALL, // 87 STR_HELIX_UP_SMALL, // 88 STR_HELIX_DOWN_SMALL, // 89 @@ -4574,13 +4574,13 @@ namespace OpenRCT2::TrackMetaData STR_HELIX_UP_LARGE, // 92 STR_HELIX_DOWN_LARGE, // 93 STR_HELIX_DOWN_LARGE, // 94 - STR_EMPTY, // 95 - STR_EMPTY, // 96 - STR_EMPTY, // 97 - STR_EMPTY, // 98 + kStringIdEmpty, // 95 + kStringIdEmpty, // 96 + kStringIdEmpty, // 97 + kStringIdEmpty, // 98 STR_BRAKES, // 99 STR_BOOSTER, // 100 - STR_EMPTY, // 101 + kStringIdEmpty, // 101 STR_HELIX_UP_LARGE, // 102 STR_HELIX_UP_LARGE, // 103 STR_HELIX_DOWN_LARGE, // 104 @@ -4589,78 +4589,78 @@ namespace OpenRCT2::TrackMetaData STR_HELIX_UP_RIGHT, // 107 STR_HELIX_DOWN_LEFT, // 108 STR_HELIX_DOWN_RIGHT, // 109 - STR_EMPTY, // TrackElemType::Up25LeftBanked - STR_EMPTY, // TrackElemType::Up25RighBanked + kStringIdEmpty, // TrackElemType::Up25LeftBanked + kStringIdEmpty, // TrackElemType::Up25RighBanked STR_WATERFALLS, // 112 STR_RAPIDS, // 113 STR_ON_RIDE_PHOTO_SECTION, // 114 - STR_EMPTY, // TrackElemType::Down25LeftBanked - STR_EMPTY, // TrackElemType::Down25RightBanked + kStringIdEmpty, // TrackElemType::Down25LeftBanked + kStringIdEmpty, // TrackElemType::Down25RightBanked STR_WATER_SPLASH, // 117 - STR_EMPTY, // 118 - STR_EMPTY, // 119 + kStringIdEmpty, // 118 + kStringIdEmpty, // 119 STR_WHIRLPOOL, // 120 - STR_EMPTY, // 121 - STR_EMPTY, // 122 + kStringIdEmpty, // 121 + kStringIdEmpty, // 122 STR_CABLE_LIFT_HILL, // 123 STR_SLOPE_UP_TO_VERTICAL, // 124 STR_VERTICAL_TRACK, // 125 - STR_EMPTY, // 126 - STR_EMPTY, // 127 - STR_EMPTY, // 128 - STR_EMPTY, // 129 - STR_EMPTY, // 130 - STR_EMPTY, // 131 + kStringIdEmpty, // 126 + kStringIdEmpty, // 127 + kStringIdEmpty, // 128 + kStringIdEmpty, // 129 + kStringIdEmpty, // 130 + kStringIdEmpty, // 131 STR_HOLDING_BRAKE_FOR_DROP, // 132 - STR_EMPTY, // 133 - STR_EMPTY, // 134 - STR_EMPTY, // 135 - STR_EMPTY, // 136 - STR_EMPTY, // 137 - STR_EMPTY, // 138 - STR_EMPTY, // 139 - STR_EMPTY, // 140 - STR_EMPTY, // 141 - STR_EMPTY, // 142 - STR_EMPTY, // 143 - STR_EMPTY, // 144 - STR_EMPTY, // 145 - STR_EMPTY, // 146 - STR_EMPTY, // 147 - STR_EMPTY, // 148 - STR_EMPTY, // 149 - STR_EMPTY, // 150 - STR_EMPTY, // 151 - STR_EMPTY, // 152 - STR_EMPTY, // 153 - STR_EMPTY, // 154 - STR_EMPTY, // 155 - STR_EMPTY, // 156 - STR_EMPTY, // 157 - STR_EMPTY, // 158 - STR_EMPTY, // 159 - STR_EMPTY, // 160 - STR_EMPTY, // 161 - STR_EMPTY, // 162 - STR_EMPTY, // 163 - STR_EMPTY, // 164 - STR_EMPTY, // 165 - STR_EMPTY, // 166 - STR_EMPTY, // 167 - STR_EMPTY, // 168 - STR_EMPTY, // 169 - STR_EMPTY, // 170 - STR_EMPTY, // 171 + kStringIdEmpty, // 133 + kStringIdEmpty, // 134 + kStringIdEmpty, // 135 + kStringIdEmpty, // 136 + kStringIdEmpty, // 137 + kStringIdEmpty, // 138 + kStringIdEmpty, // 139 + kStringIdEmpty, // 140 + kStringIdEmpty, // 141 + kStringIdEmpty, // 142 + kStringIdEmpty, // 143 + kStringIdEmpty, // 144 + kStringIdEmpty, // 145 + kStringIdEmpty, // 146 + kStringIdEmpty, // 147 + kStringIdEmpty, // 148 + kStringIdEmpty, // 149 + kStringIdEmpty, // 150 + kStringIdEmpty, // 151 + kStringIdEmpty, // 152 + kStringIdEmpty, // 153 + kStringIdEmpty, // 154 + kStringIdEmpty, // 155 + kStringIdEmpty, // 156 + kStringIdEmpty, // 157 + kStringIdEmpty, // 158 + kStringIdEmpty, // 159 + kStringIdEmpty, // 160 + kStringIdEmpty, // 161 + kStringIdEmpty, // 162 + kStringIdEmpty, // 163 + kStringIdEmpty, // 164 + kStringIdEmpty, // 165 + kStringIdEmpty, // 166 + kStringIdEmpty, // 167 + kStringIdEmpty, // 168 + kStringIdEmpty, // 169 + kStringIdEmpty, // 170 + kStringIdEmpty, // 171 STR_REVERSER_TURNTABLE, // 172 STR_SPINNING_TUNNEL, // 173 STR_BARREL_ROLL_LEFT, // 174 STR_BARREL_ROLL_RIGHT, // 175 STR_BARREL_ROLL_LEFT, // 176 STR_BARREL_ROLL_RIGHT, // 177 - STR_EMPTY, // 178 - STR_EMPTY, // 179 - STR_EMPTY, // 180 - STR_EMPTY, // 181 + kStringIdEmpty, // 178 + kStringIdEmpty, // 179 + kStringIdEmpty, // 180 + kStringIdEmpty, // 181 STR_LAUNCHED_LIFT_HILL, // 182 STR_LARGE_HALF_LOOP_LEFT, // 183 STR_LARGE_HALF_LOOP_RIGHT, // 184 @@ -4696,56 +4696,56 @@ namespace OpenRCT2::TrackMetaData STR_VERTICAL_TRACK, // 214 STR_SLOPE_TO_LEVEL, // 215 STR_BLOCK_BRAKES, // 216 - STR_EMPTY, // 217 - STR_EMPTY, // 218 - STR_EMPTY, // 219 - STR_EMPTY, // 220 - STR_EMPTY, // 221 - STR_EMPTY, // 222 - STR_EMPTY, // 223 - STR_EMPTY, // 224 - STR_EMPTY, // 225 - STR_EMPTY, // 226 - STR_EMPTY, // 227 - STR_EMPTY, // 228 - STR_EMPTY, // 229 - STR_EMPTY, // 230 - STR_EMPTY, // 231 - STR_EMPTY, // 232 - STR_EMPTY, // 233 - STR_EMPTY, // 234 - STR_EMPTY, // 235 - STR_EMPTY, // 236 - STR_EMPTY, // 237 - STR_EMPTY, // 238 - STR_EMPTY, // 239 - STR_EMPTY, // 240 - STR_EMPTY, // 241 - STR_EMPTY, // 242 - STR_EMPTY, // 243 - STR_EMPTY, // 244 - STR_EMPTY, // 245 - STR_EMPTY, // 246 - STR_EMPTY, // 247 - STR_EMPTY, // 248 - STR_EMPTY, // 249 - STR_EMPTY, // 250 - STR_EMPTY, // 251 - STR_EMPTY, // 252 + kStringIdEmpty, // 217 + kStringIdEmpty, // 218 + kStringIdEmpty, // 219 + kStringIdEmpty, // 220 + kStringIdEmpty, // 221 + kStringIdEmpty, // 222 + kStringIdEmpty, // 223 + kStringIdEmpty, // 224 + kStringIdEmpty, // 225 + kStringIdEmpty, // 226 + kStringIdEmpty, // 227 + kStringIdEmpty, // 228 + kStringIdEmpty, // 229 + kStringIdEmpty, // 230 + kStringIdEmpty, // 231 + kStringIdEmpty, // 232 + kStringIdEmpty, // 233 + kStringIdEmpty, // 234 + kStringIdEmpty, // 235 + kStringIdEmpty, // 236 + kStringIdEmpty, // 237 + kStringIdEmpty, // 238 + kStringIdEmpty, // 239 + kStringIdEmpty, // 240 + kStringIdEmpty, // 241 + kStringIdEmpty, // 242 + kStringIdEmpty, // 243 + kStringIdEmpty, // 244 + kStringIdEmpty, // 245 + kStringIdEmpty, // 246 + kStringIdEmpty, // 247 + kStringIdEmpty, // 248 + kStringIdEmpty, // 249 + kStringIdEmpty, // 250 + kStringIdEmpty, // 251 + kStringIdEmpty, // 252 STR_QUARTER_LOOP, // 253 STR_QUARTER_LOOP, // 254 STR_QUARTER_LOOP, // 255 STR_SPINNING_CONTROL_TOGGLE_TRACK, // 256 - STR_EMPTY, // TrackElemType::FlatTrack1x4A + kStringIdEmpty, // TrackElemType::FlatTrack1x4A STR_BASE_SIZE_2_X_2, // TrackElemType::FlatTrack2x2 STR_BASE_SIZE_4_X_4, // TrackElemType::FlatTrack4x4 STR_BASE_SIZE_2_X_4, // TrackElemType::FlatTrack2x4 STR_BASE_SIZE_5_X_1, // TrackElemType::FlatTrack1x5 - STR_EMPTY, // TrackElemType::FlatTrack1x1A - STR_EMPTY, // TrackElemType::FlatTrack1x4B - STR_EMPTY, // TrackElemType::FlatTrack1x1B - STR_EMPTY, // TrackElemType::FlatTrack1x4C - STR_EMPTY, // TrackElemType::FlatTrack3x3 + kStringIdEmpty, // TrackElemType::FlatTrack1x1A + kStringIdEmpty, // TrackElemType::FlatTrack1x4B + kStringIdEmpty, // TrackElemType::FlatTrack1x1B + kStringIdEmpty, // TrackElemType::FlatTrack1x4C + kStringIdEmpty, // TrackElemType::FlatTrack3x3 STR_LARGE_HALF_CORKSCREW_LEFT, // TrackElemType::LeftCorkscrewUp STR_LARGE_HALF_CORKSCREW_RIGHT, // TrackElemType::RightCorkscrewUp STR_LARGE_HALF_CORKSCREW_LEFT, // TrackElemType::LeftCorkscrewDown @@ -4772,58 +4772,58 @@ namespace OpenRCT2::TrackMetaData STR_LARGE_HALF_LOOP_RIGHT, // TrackElemType::RightFlyerLargeHalfLoopUninvertedDown STR_HALF_LOOP, // TrackElemType::FlyerHalfLoopInvertedUp STR_HALF_LOOP, // TrackElemType::FlyerHalfLoopUninvertedDown - STR_EMPTY, // TrackElemType::LeftEighthToDiagUp25 - STR_EMPTY, // TrackElemType::RightEighthToDiagUp25 - STR_EMPTY, // TrackElemType::LeftEighthToDiagDown25 - STR_EMPTY, // TrackElemType::RightEighthToDiagDown25 - STR_EMPTY, // TrackElemType::LeftEighthToOrthogonalUp25 - STR_EMPTY, // TrackElemType::RightEighthToOrthogonalUp25 - STR_EMPTY, // TrackElemType::LeftEighthToOrthogonalDown25 - STR_EMPTY, // TrackElemType::RightEighthToOrthogonalDown25 - STR_EMPTY, // TrackElemType::DiagUp25ToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagUp25ToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToUp25 - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToUp25 - STR_EMPTY, // TrackElemType::DiagDown25ToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagDown25ToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToDown25 - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagRightBankedFlatToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat - STR_EMPTY, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagRightBankedFlatToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat - STR_EMPTY, // TrackElemType::DiagFlatToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagFlatToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToFlat - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToFlat - STR_EMPTY, // TrackElemType::DiagFlatToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagFlatToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToFlat - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToFlat - STR_EMPTY, // TrackElemType::Up25LeftBanked - STR_EMPTY, // TrackElemType::Up25RightBanked - STR_EMPTY, // TrackElemType::Down25LeftBanked - STR_EMPTY, // TrackElemType::Down25RightBanked - STR_EMPTY, // TrackElemType::LeftEighthBankToDiagUp25 - STR_EMPTY, // TrackElemType::RightEighthBankToDiagUp25 - STR_EMPTY, // TrackElemType::LeftEighthBankToDiagDown25 - STR_EMPTY, // TrackElemType::RightEighthBankToDiagDown25 - STR_EMPTY, // TrackElemType::LeftEighthBankToOrthogonalUp25 - STR_EMPTY, // TrackElemType::RightEighthBankToOrthogonalUp25 - STR_EMPTY, // TrackElemType::LeftEighthBankToOrthogonalDown25 - STR_EMPTY, // TrackElemType::RightEighthBankToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::LeftEighthToDiagUp25 + kStringIdEmpty, // TrackElemType::RightEighthToDiagUp25 + kStringIdEmpty, // TrackElemType::LeftEighthToDiagDown25 + kStringIdEmpty, // TrackElemType::RightEighthToDiagDown25 + kStringIdEmpty, // TrackElemType::LeftEighthToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::RightEighthToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::LeftEighthToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::RightEighthToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::DiagUp25ToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagUp25ToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToUp25 + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToUp25 + kStringIdEmpty, // TrackElemType::DiagDown25ToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagDown25ToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToDown25 + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagRightBankedFlatToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat + kStringIdEmpty, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagRightBankedFlatToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat + kStringIdEmpty, // TrackElemType::DiagFlatToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagFlatToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToFlat + kStringIdEmpty, // TrackElemType::DiagFlatToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagFlatToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToFlat + kStringIdEmpty, // TrackElemType::Up25LeftBanked + kStringIdEmpty, // TrackElemType::Up25RightBanked + kStringIdEmpty, // TrackElemType::Down25LeftBanked + kStringIdEmpty, // TrackElemType::Down25RightBanked + kStringIdEmpty, // TrackElemType::LeftEighthBankToDiagUp25 + kStringIdEmpty, // TrackElemType::RightEighthBankToDiagUp25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToDiagDown25 + kStringIdEmpty, // TrackElemType::RightEighthBankToDiagDown25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::RightEighthBankToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::RightEighthBankToOrthogonalDown25 STR_BRAKES, // TrackElemType::DiagBrakes STR_BLOCK_BRAKES, // TrackElemType::DiagBlockBrakes STR_BRAKES, // TrackElemType::Down25Brakes STR_BOOSTER, // TrackElemType::DiagBooster - STR_EMPTY, // TrackElemType::DiagFlatToUp60LongBase, - STR_EMPTY, // TrackElemType::DiagUp60ToFlatLongBase, - STR_EMPTY, // TrackElemType::DiagFlatToDown60LongBase, - STR_EMPTY, // TrackElemType::DiagDown60ToFlatLongBase, + kStringIdEmpty, // TrackElemType::DiagFlatToUp60LongBase, + kStringIdEmpty, // TrackElemType::DiagUp60ToFlatLongBase, + kStringIdEmpty, // TrackElemType::DiagFlatToDown60LongBase, + kStringIdEmpty, // TrackElemType::DiagDown60ToFlatLongBase, STR_DIVE_LOOP_LEFT, // TrackElemType::LeftEighthDiveLoopUpToOrthogonal STR_DIVE_LOOP_RIGHT, // TrackElemType::RightEighthDiveLoopUpToOrthogonal STR_DIVE_LOOP_LEFT, // TrackElemType::LeftEighthDiveLoopDownToDiag diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 42fbf78e245f..3326069dd4b1 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -186,7 +186,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con return { false, STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY }; } - StringId warningMessage = STR_NONE; + StringId warningMessage = kStringIdNone; RideGetStartOfTrack(&trackElement); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 33dda7dc5686..c46255ef8346 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -652,7 +652,7 @@ bool TrackPaintUtilDrawStationCovers2( } auto baseImageIndex = stationObject->ShelterImageId; - if (baseImageIndex == ImageIndexUndefined) + if (baseImageIndex == kImageIndexUndefined) return false; static constexpr int16_t heights[][2] = { diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 1c0d7d8610e4..6420759ea944 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -612,7 +612,7 @@ class ScenarioRepository final : public IScenarioRepository std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; - highscore->timestamp = DATETIME64_MIN; + highscore->timestamp = kDatetime64Min; break; } } @@ -624,7 +624,7 @@ class ScenarioRepository final : public IScenarioRepository std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; - highscore->timestamp = DATETIME64_MIN; + highscore->timestamp = kDatetime64Min; } } } diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 302cb2768074..644951588906 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -715,7 +715,7 @@ void ScriptEngine::LoadPlugin(std::shared_ptr& plugin) if (!plugin->IsLoaded()) { const auto& metadata = plugin->GetMetadata(); - if (metadata.MinApiVersion <= OPENRCT2_PLUGIN_API_VERSION) + if (metadata.MinApiVersion <= kPluginApiVersion) { ScriptExecutionInfo::PluginScope scope(_execInfo, plugin, false); plugin->Load(); @@ -1087,7 +1087,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const CustomAct } std::vector pluginCallArgs; - if (customActionInfo.Owner->GetTargetAPIVersion() <= API_VERSION_68_CUSTOM_ACTION_ARGS) + if (customActionInfo.Owner->GetTargetAPIVersion() <= kApiVersionCustomActionArgs) { pluginCallArgs = { *dukArgs }; } @@ -1847,7 +1847,7 @@ int32_t OpenRCT2::Scripting::GetTargetAPIVersion() if (plugin == nullptr) { // For in-game console, default to the current API version - return OPENRCT2_PLUGIN_API_VERSION; + return kPluginApiVersion; } return plugin->GetTargetAPIVersion(); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index c54998302464..e3b323cd78b1 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,13 +46,13 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 104; + static constexpr int32_t kPluginApiVersion = 104; // Versions marking breaking changes. - static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; - static constexpr int32_t API_VERSION_63_G2_REORDER = 63; - static constexpr int32_t API_VERSION_68_CUSTOM_ACTION_ARGS = 68; - static constexpr int32_t API_VERSION_77_NETWORK_IDS = 77; + static constexpr int32_t kApiVersionPeepDeprecation = 33; + static constexpr int32_t kApiVersionG2Reorder = 63; + static constexpr int32_t kApiVersionCustomActionArgs = 68; + static constexpr int32_t kApiVersionNetworkIDs = 77; #ifndef DISABLE_NETWORK class ScSocketBase; diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index a2f23424a1dc..df0e5eda03d9 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -58,11 +58,11 @@ namespace OpenRCT2::Scripting case EntityType::Vehicle: return "car"; case EntityType::Guest: - if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "guest"; case EntityType::Staff: - if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "staff"; case EntityType::SteamParticle: diff --git a/src/openrct2/scripting/bindings/game/ScContext.hpp b/src/openrct2/scripting/bindings/game/ScContext.hpp index 2cb18eabd9a4..c61d48c657ad 100644 --- a/src/openrct2/scripting/bindings/game/ScContext.hpp +++ b/src/openrct2/scripting/bindings/game/ScContext.hpp @@ -47,7 +47,7 @@ namespace OpenRCT2::Scripting private: int32_t apiVersion_get() { - return OPENRCT2_PLUGIN_API_VERSION; + return kPluginApiVersion; } std::shared_ptr configuration_get() @@ -472,7 +472,7 @@ namespace OpenRCT2::Scripting if (d.type() == DukValue::Type::NUMBER) { img = d.as_uint(); - if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + if (GetTargetAPIVersion() <= kApiVersionG2Reorder) { img = NewIconIndex(d.as_uint()); } diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.cpp b/src/openrct2/scripting/bindings/network/ScNetwork.cpp index 89454fd070f7..e96475d109e5 100644 --- a/src/openrct2/scripting/bindings/network/ScNetwork.cpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.cpp @@ -114,7 +114,7 @@ namespace OpenRCT2::Scripting std::shared_ptr ScNetwork::getPlayer(int32_t id) const { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numPlayers = NetworkGetNumPlayers(); @@ -173,7 +173,7 @@ namespace OpenRCT2::Scripting std::shared_ptr ScNetwork::getGroup(int32_t id) const { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numGroups = NetworkGetNumGroups(); @@ -206,7 +206,7 @@ namespace OpenRCT2::Scripting void ScNetwork::removeGroup(int32_t id) { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numGroups = NetworkGetNumGroups(); @@ -232,7 +232,7 @@ namespace OpenRCT2::Scripting void ScNetwork::kickPlayer(int32_t id) { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numPlayers = NetworkGetNumPlayers(); diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index d877196d95b4..dceb9addaf28 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -55,7 +55,7 @@ namespace OpenRCT2::Scripting int32_t ScMap::numEntities_get() const { - return MAX_ENTITIES; + return kMaxEntities; } std::vector> ScMap::rides_get() const @@ -88,7 +88,7 @@ namespace OpenRCT2::Scripting DukValue ScMap::getEntity(int32_t id) const { - if (id >= 0 && id < MAX_ENTITIES) + if (id >= 0 && id < kMaxEntities) { auto spriteId = EntityId::FromUnderlying(id); auto sprite = GetEntity(spriteId); diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 1703c4301db2..cf2b2e6b3768 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -21,7 +21,7 @@ enum : ImageIndex SPR_DEFAULT_PALETTE = 1532, SPR_SCROLLING_TEXT_LEGACY_START = 1542, - SPR_SCROLLING_TEXT_LEGACY_END = SPR_SCROLLING_TEXT_LEGACY_START + OpenRCT2::MaxScrollingTextLegacyEntries, + SPR_SCROLLING_TEXT_LEGACY_END = SPR_SCROLLING_TEXT_LEGACY_START + OpenRCT2::kMaxScrollingTextLegacyEntries, SPR_SCROLLING_TEXT_DEFAULT = 1574, SPR_EDGE_ROCK_BASE = 1579, @@ -1707,7 +1707,7 @@ enum : ImageIndex G2_SPRITE_COUNT = SPR_G2_END - SPR_G2_BEGIN, SPR_SCROLLING_TEXT_START = SPR_CSG_END, - SPR_SCROLLING_TEXT_END = SPR_SCROLLING_TEXT_START + OpenRCT2::MaxScrollingTextEntries, + SPR_SCROLLING_TEXT_END = SPR_SCROLLING_TEXT_START + OpenRCT2::kMaxScrollingTextEntries, SPR_IMAGE_LIST_LENGTH = 1000000, SPR_IMAGE_LIST_BEGIN = SPR_SCROLLING_TEXT_END, diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 8103ae5dd94a..6d9a0a82d3ee 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -156,7 +156,7 @@ GameActions::Result MapCanConstructWithClearAt( if (tileElement == nullptr) { res.Error = GameActions::Status::Unknown; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = kStringIdNone; return res; } @@ -321,7 +321,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } @@ -344,7 +344,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* wallEntry = tileElement->AsWall()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); + StringId stringId = wallEntry != nullptr ? wallEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } @@ -353,7 +353,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 78411fece136..7d2841643255 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -475,7 +475,7 @@ static bool FootpathDisconnectQueueFromPath(const CoordsXY& footpathPos, TileEle return true; } - for (Direction direction : ALL_DIRECTIONS) + for (Direction direction : kAllDirections) { if ((action < 0) && (direction == tileElement->AsPath()->GetSlopeDirection())) continue; @@ -748,7 +748,7 @@ void FootpathConnectEdges(const CoordsXY& footpathPos, TileElement* tileElement, FootpathNeighbourListInit(&neighbourList); FootpathUpdateQueueEntranceBanner(footpathPos, tileElement); - for (Direction direction : ALL_DIRECTIONS) + for (Direction direction : kAllDirections) { Loc6A6C85({ footpathPos, tileElement }, direction, flags, true, &neighbourList); } diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index e7c8c6a617b8..46a69cda6b29 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -540,9 +540,9 @@ const Direction INVALID_DIRECTION = 0xFF; /** * Array of all valid cardinal directions, to make it easy to write range-based for loops like: - * for (Direction d : ALL_DIRECTIONS) + * for (Direction d : kAllDirections) */ -constexpr Direction ALL_DIRECTIONS[] = { +constexpr Direction kAllDirections[] = { 0, 1, 2, diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 0fea265f7601..d6cb5b68375f 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -324,7 +324,7 @@ namespace OpenRCT2::TileInspector if (newBanner == nullptr) { LOG_ERROR("No free banners available"); - return GameActions::Result(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, kStringIdNone); } auto newId = newBanner->id; // Copy the banners style From a8773dd80538f5b2dd531f4ac153252487ac265f Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 19 Jan 2025 18:49:18 +0100 Subject: [PATCH 6/8] Move WindowClose family into WindowManager (#23646) * Replace WindowClose() calls with Close method calls where possible * Move WindowClose family into WindowManager * Remove UpdateSceneryGroupIndexes hack --- src/openrct2-ui/WindowManager.cpp | 178 ++++++++++++++++- src/openrct2-ui/input/MouseInput.cpp | 13 +- src/openrct2-ui/input/ShortcutManager.cpp | 6 +- src/openrct2-ui/input/Shortcuts.cpp | 33 ++-- src/openrct2-ui/interface/Window.cpp | 12 +- src/openrct2-ui/scripting/CustomWindow.cpp | 8 +- src/openrct2-ui/scripting/ScUi.hpp | 8 +- src/openrct2-ui/scripting/ScWindow.hpp | 3 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 41 ++-- .../windows/DemolishRidePrompt.cpp | 3 +- src/openrct2-ui/windows/Dropdown.cpp | 3 +- .../windows/EditorBottomToolbar.cpp | 30 ++- .../windows/EditorInventionsList.cpp | 2 +- .../windows/EditorObjectSelection.cpp | 8 +- .../windows/EditorScenarioOptions.cpp | 6 +- src/openrct2-ui/windows/Error.cpp | 4 +- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/InstallTrack.cpp | 6 +- src/openrct2-ui/windows/LoadSave.cpp | 31 +-- src/openrct2-ui/windows/Map.cpp | 4 +- src/openrct2-ui/windows/MapTooltip.cpp | 3 +- src/openrct2-ui/windows/MazeConstruction.cpp | 5 +- src/openrct2-ui/windows/NewCampaign.cpp | 5 +- src/openrct2-ui/windows/NewRide.cpp | 8 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 2 +- src/openrct2-ui/windows/Options.cpp | 10 +- .../windows/RefurbishRidePrompt.cpp | 3 +- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 15 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/SavePrompt.cpp | 2 +- src/openrct2-ui/windows/Scenery.cpp | 13 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 5 +- src/openrct2-ui/windows/Staff.cpp | 6 +- src/openrct2-ui/windows/TextInput.cpp | 10 +- src/openrct2-ui/windows/TitleMenu.cpp | 12 +- src/openrct2-ui/windows/Tooltip.cpp | 4 +- src/openrct2-ui/windows/TopToolbar.cpp | 12 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 19 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 12 +- src/openrct2-ui/windows/TrackList.cpp | 11 +- src/openrct2-ui/windows/ViewClipping.cpp | 2 +- src/openrct2/Context.cpp | 4 +- src/openrct2/Editor.cpp | 3 +- src/openrct2/Game.cpp | 10 +- src/openrct2/actions/LoadOrQuitAction.cpp | 6 +- src/openrct2/actions/RideDemolishAction.cpp | 12 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/StaffFireAction.cpp | 7 +- src/openrct2/command_line/ConvertCommand.cpp | 4 +- src/openrct2/entity/Peep.cpp | 6 +- src/openrct2/interface/InteractiveConsole.cpp | 4 +- src/openrct2/interface/Window.cpp | 183 +----------------- src/openrct2/interface/Window.h | 11 -- src/openrct2/network/NetworkBase.cpp | 4 +- src/openrct2/object/ObjectManager.cpp | 6 +- src/openrct2/park/ParkFile.cpp | 5 +- src/openrct2/ride/Ride.cpp | 6 +- src/openrct2/scenario/Scenario.cpp | 8 +- src/openrct2/ui/DummyWindowManager.cpp | 12 ++ src/openrct2/ui/WindowManager.h | 12 ++ .../world/tile_element/TileElement.cpp | 5 +- 63 files changed, 499 insertions(+), 377 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 1c77a8d2322b..2b21de26d1eb 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,12 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; using namespace OpenRCT2::Ui::Windows; +namespace WindowCloseFlags +{ + static constexpr uint32_t None = 0; + static constexpr uint32_t CloseSingle = (1 << 0); +} // namespace WindowCloseFlags + class WindowManager final : public IWindowManager { public: @@ -426,7 +433,7 @@ class WindowManager final : public IWindowManager auto w = FindByClass(WindowClass::RideConstruction); if (w == nullptr || w->number != static_cast(rideIndex)) { - WindowCloseConstructionWindows(); + CloseConstructionWindows(); _currentRideIndex = RideId::FromUnderlying(rideIndex); OpenWindow(WindowClass::RideConstruction); } @@ -851,7 +858,7 @@ class WindowManager final : public IWindowManager continue; if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) { - WindowClose(*w.get()); + Close(*w.get()); break; } } @@ -915,6 +922,173 @@ class WindowManager final : public IWindowManager return w; } + /** + * Closes the specified window. + * rct2: 0x006ECD4C + * + * @param window The window to close (esi). + */ + void Close(WindowBase& w) override + { + w.OnClose(); + + // Remove viewport + w.RemoveViewport(); + + // Invalidate the window (area) + w.Invalidate(); + + w.flags |= WF_DEAD; + } + + void CloseSurplus(int32_t cap, WindowClass avoid_classification) override + { + // find the amount of windows that are currently open + auto count = static_cast(g_window_list.size()); + // difference between amount open and cap = amount to close + auto diff = count - kWindowLimitReserved - cap; + for (auto i = 0; i < diff; i++) + { + // iterates through the list until it finds the newest window, or a window that can be closed + WindowBase* foundW{}; + for (auto& w : g_window_list) + { + if (w->flags & WF_DEAD) + continue; + if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) + { + foundW = w.get(); + break; + } + } + // skip window if window matches specified WindowClass (as user may be modifying via options) + if (avoid_classification != WindowClass::Null && foundW != nullptr + && foundW->classification == avoid_classification) + { + continue; + } + Close(*foundW); + } + } + + template + void CloseByCondition(TPred pred, uint32_t flags = WindowCloseFlags::None) + { + for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); ++it) + { + auto& wnd = *(*it); + if (wnd.flags & WF_DEAD) + continue; + + if (pred(&wnd)) + { + Close(wnd); + if (flags & WindowCloseFlags::CloseSingle) + { + return; + } + } + } + } + + /** + * Closes all windows with the specified window class. + * rct2: 0x006ECCF4 + * @param cls (cl) with bit 15 set + */ + void CloseByClass(WindowClass cls) override + { + CloseByCondition([&](WindowBase* w) -> bool { return w->classification == cls; }); + } + + /** + * Closes all windows with specified window class and number. + * rct2: 0x006ECCF4 + * @param cls (cl) without bit 15 set + * @param number (dx) + */ + void CloseByNumber(WindowClass cls, rct_windownumber number) override + { + CloseByCondition([cls, number](WindowBase* w) -> bool { return w->classification == cls && w->number == number; }); + } + + // TODO: Refactor this to use variant once the new window class is done. + void CloseByNumber(WindowClass cls, EntityId number) override + { + CloseByNumber(cls, static_cast(number.ToUnderlying())); + } + + /** + * Closes the top-most window + * + * rct2: 0x006E403C + */ + void CloseTop() override + { + CloseByClass(WindowClass::Dropdown); + + if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + if (GetGameState().EditorStep != EditorStep::LandscapeEditor) + return; + } + + auto pred = [](WindowBase* w) -> bool { return !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); }; + CloseByCondition(pred, WindowCloseFlags::CloseSingle); + } + + /** + * Closes all open windows + * + * rct2: 0x006EE927 + */ + void CloseAll() override + { + CloseByClass(WindowClass::Dropdown); + CloseByCondition([](WindowBase* w) -> bool { return !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); }); + } + + void CloseAllExceptClass(WindowClass cls) override + { + CloseByClass(WindowClass::Dropdown); + CloseByCondition([cls](WindowBase* w) -> bool { + return w->classification != cls && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); + }); + } + + /** + * Closes all windows, save for those having any of the passed flags. + */ + void CloseAllExceptFlags(uint16_t flags) override + { + CloseByCondition([flags](WindowBase* w) -> bool { return !(w->flags & flags); }); + } + + /** + * Closes all windows except the specified window number and class. + * @param number (dx) + * @param cls (cl) without bit 15 set + */ + void CloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls) override + { + CloseByClass(WindowClass::Dropdown); + CloseByCondition([cls, number](WindowBase* w) -> bool { + return (!(w->number == number && w->classification == cls) && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))); + }); + } + + /** + * + * rct2: 0x006CBCC3 + */ + void CloseConstructionWindows() override + { + CloseByClass(WindowClass::RideConstruction); + CloseByClass(WindowClass::Footpath); + CloseByClass(WindowClass::TrackDesignList); + CloseByClass(WindowClass::TrackDesignPlace); + } + /** * Finds the first window with the specified window class. * rct2: 0x006EA8A0 diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index f4d64b15a33d..85c6eb1deb9f 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -308,7 +308,7 @@ namespace OpenRCT2 InputWidgetLeft(screenCoords, w, widgetIndex); break; case MouseState::RightPress: - WindowCloseByClass(WindowClass::Tooltip); + windowMgr->CloseByClass(WindowClass::Tooltip); if (w != nullptr) { @@ -1044,11 +1044,11 @@ namespace OpenRCT2 windowNumber = w->number; } - WindowCloseByClass(WindowClass::Error); - WindowCloseByClass(WindowClass::Tooltip); + auto* windowMgr = GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Error); + windowMgr->CloseByClass(WindowClass::Tooltip); // Window might have changed position in the list, therefore find it again - auto* windowMgr = GetWindowManager(); w = windowMgr->FindByNumber(windowClass, windowNumber); if (w == nullptr) return; @@ -1422,7 +1422,7 @@ namespace OpenRCT2 } } - WindowCloseByClass(WindowClass::Dropdown); + windowMgr->CloseByClass(WindowClass::Dropdown); if (dropdownCleanup) { @@ -1585,7 +1585,8 @@ namespace OpenRCT2 if (gCurrentRealTimeTicks >= gTooltipCloseTimeout) { - WindowCloseByClass(WindowClass::Tooltip); + auto* windowMgr = GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Tooltip); } } } diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index b1423f7316fa..6029cea28757 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include using namespace OpenRCT2::Ui; @@ -174,7 +174,9 @@ void ShortcutManager::ProcessEvent(const InputEvent& e) shortcut->Current.push_back(std::move(shortcutInput.value())); } _pendingShortcutChange.clear(); - WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ChangeKeyboardShortcut); SaveUserBindings(); } } diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index de1401101c29..9a9b88b7f268 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -158,11 +157,11 @@ static void ShortcutRemoveTopBottomToolbarToggle() { if (windowMgr->FindByClass(WindowClass::TitleLogo) != nullptr) { - WindowCloseByClass(WindowClass::TitleLogo); - WindowCloseByClass(WindowClass::TitleOptions); - WindowCloseByClass(WindowClass::TitleMenu); - WindowCloseByClass(WindowClass::TitleExit); - WindowCloseByClass(WindowClass::TitleVersion); + windowMgr->CloseByClass(WindowClass::TitleLogo); + windowMgr->CloseByClass(WindowClass::TitleOptions); + windowMgr->CloseByClass(WindowClass::TitleMenu); + windowMgr->CloseByClass(WindowClass::TitleExit); + windowMgr->CloseByClass(WindowClass::TitleVersion); } else { @@ -173,9 +172,9 @@ static void ShortcutRemoveTopBottomToolbarToggle() { if (windowMgr->FindByClass(WindowClass::TopToolbar) != nullptr) { - WindowCloseByClass(WindowClass::Dropdown); - WindowCloseByClass(WindowClass::TopToolbar); - WindowCloseByClass(WindowClass::BottomToolbar); + windowMgr->CloseByClass(WindowClass::Dropdown); + windowMgr->CloseByClass(WindowClass::TopToolbar); + windowMgr->CloseByClass(WindowClass::BottomToolbar); } else { @@ -376,7 +375,7 @@ static void ShortcutOpenCheatWindow() WindowBase* window = windowMgr->FindByClass(WindowClass::Cheats); if (window != nullptr) { - WindowClose(*window); + windowMgr->Close(*window); return; } ContextOpenWindow(WindowClass::Cheats); @@ -748,15 +747,19 @@ void ShortcutManager::RegisterDefaultShortcuts() { // clang-format off // Interface - RegisterShortcut(ShortcutId::kInterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", WindowCloseTop); + RegisterShortcut(ShortcutId::kInterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", []() { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseTop(); + }); RegisterShortcut(ShortcutId::kInterfaceCloseAll, STR_SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS, "SHIFT+BACKSPACE", []() { + auto* windowMgr = GetWindowManager(); if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)) { - WindowCloseAll(); + windowMgr->CloseAll(); } else if (GetGameState().EditorStep == EditorStep::LandscapeEditor) { - WindowCloseTop(); + windowMgr->CloseTop(); } }); RegisterShortcut(ShortcutId::kInterfaceRotateConstruction, STR_SHORTCUT_ROTATE_CONSTRUCTION_OBJECT, "Z", ShortcutRotateConstructionObject); @@ -767,7 +770,7 @@ void ShortcutManager::RegisterDefaultShortcuts() auto window = windowMgr->FindByClass(WindowClass::Error); if (window != nullptr) { - WindowClose(*window); + windowMgr->Close(*window); } else if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) { @@ -904,7 +907,7 @@ void ShortcutManager::RegisterDefaultShortcuts() auto window = windowMgr->FindByClass(WindowClass::DebugPaint); if (window != nullptr) { - WindowClose(*window); + windowMgr->Close(*window); } else { diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 48376cecd8b5..def4b4e0e0bc 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -423,18 +423,21 @@ namespace OpenRCT2 } else { - WindowClose(*this); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->Close(*this); } } void Window::CloseOthers() { - WindowCloseAllExceptNumberAndClass(number, classification); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAllExceptNumberAndClass(number, classification); } void Window::CloseOthersOfThisClass() { - WindowCloseByClass(classification); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(classification); } CloseWindowModifier Window::GetCloseModifier() @@ -597,7 +600,8 @@ namespace OpenRCT2::Ui::Windows _currentTextBox.widget_index = callWidget; _textBoxFrameNo = 0; - WindowCloseByClass(WindowClass::Textinput); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Textinput); _textBoxInput = existingText; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 41e308b78b46..104cdc2c9467 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -580,8 +580,11 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->Close(*this); break; + } default: { if (widgetIndex >= WIDX_TAB_0 @@ -1485,7 +1488,8 @@ namespace OpenRCT2::Ui::Windows for (auto& window : customWindows) { - WindowClose(*window.get()); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->Close(*window.get()); } } diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index de18125a4a7f..778a961353ba 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -183,23 +183,25 @@ namespace OpenRCT2::Scripting void closeWindows(std::string classification, DukValue id) { + auto* windowMgr = Ui::GetWindowManager(); auto cls = GetClassification(classification); if (cls != WindowClass::Null) { if (id.type() == DukValue::Type::NUMBER) { - WindowCloseByNumber(cls, id.as_uint()); + windowMgr->CloseByNumber(cls, id.as_uint()); } else { - WindowCloseByClass(cls); + windowMgr->CloseByClass(cls); } } } void closeAllWindows() { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); } std::shared_ptr getWindow(DukValue a) const diff --git a/src/openrct2-ui/scripting/ScWindow.hpp b/src/openrct2-ui/scripting/ScWindow.hpp index 2d973a81bb74..4d620acc3010 100644 --- a/src/openrct2-ui/scripting/ScWindow.hpp +++ b/src/openrct2-ui/scripting/ScWindow.hpp @@ -305,7 +305,8 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - WindowClose(*w); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->Close(*w); } } diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 28a215dc6067..4adba0ed30d8 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -406,26 +406,27 @@ namespace OpenRCT2::Title void CloseParkSpecificWindows() { - 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); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ConstructRide); + windowMgr->CloseByClass(WindowClass::DemolishRidePrompt); + windowMgr->CloseByClass(WindowClass::EditorInventionListDrag); + windowMgr->CloseByClass(WindowClass::EditorInventionList); + windowMgr->CloseByClass(WindowClass::EditorObjectSelection); + windowMgr->CloseByClass(WindowClass::EditorObjectiveOptions); + windowMgr->CloseByClass(WindowClass::EditorScenarioOptions); + windowMgr->CloseByClass(WindowClass::Finances); + windowMgr->CloseByClass(WindowClass::FirePrompt); + windowMgr->CloseByClass(WindowClass::GuestList); + windowMgr->CloseByClass(WindowClass::InstallTrack); + windowMgr->CloseByClass(WindowClass::Peep); + windowMgr->CloseByClass(WindowClass::Ride); + windowMgr->CloseByClass(WindowClass::RideConstruction); + windowMgr->CloseByClass(WindowClass::RideList); + windowMgr->CloseByClass(WindowClass::Scenery); + windowMgr->CloseByClass(WindowClass::Staff); + windowMgr->CloseByClass(WindowClass::TrackDeletePrompt); + windowMgr->CloseByClass(WindowClass::TrackDesignList); + windowMgr->CloseByClass(WindowClass::TrackDesignPlace); } void PrepareParkForPlayback() diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 1e5715a57fbd..adfb72ec54f7 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -108,7 +108,8 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) { auto windowPos = w->windowPos; - WindowClose(*w); + windowMgr->Close(*w); + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 0190089edf3e..488e288e13ff 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -402,7 +402,8 @@ namespace OpenRCT2::Ui::Windows void WindowDropdownClose() { - WindowCloseByClass(WindowClass::Dropdown); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Dropdown); } /** diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 27d34cd24be4..e0e56a98038d 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -155,14 +155,18 @@ namespace OpenRCT2::Ui::Windows private: void JumpBackToObjectSelection() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + GetGameState().EditorStep = EditorStep::ObjectSelection; GfxInvalidateScreen(); } void JumpBackToLandscapeEditor() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + SetAllSceneryItemsInvented(); WindowScenerySetDefaultPlacementConfiguration(); GetGameState().EditorStep = EditorStep::LandscapeEditor; @@ -172,7 +176,9 @@ namespace OpenRCT2::Ui::Windows void JumpBackToInventionListSetUp() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + ContextOpenWindow(WindowClass::EditorInventionList); GetGameState().EditorStep = EditorStep::InventionsListSetUp; GfxInvalidateScreen(); @@ -180,7 +186,9 @@ namespace OpenRCT2::Ui::Windows void JumpBackToOptionsSelection() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + ContextOpenWindow(WindowClass::EditorScenarioOptions); GetGameState().EditorStep = EditorStep::OptionsSelection; GfxInvalidateScreen(); @@ -208,7 +216,8 @@ namespace OpenRCT2::Ui::Windows auto [checksPassed, errorString] = Editor::CheckPark(); if (checksPassed) { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); ContextOpenWindow(WindowClass::EditorInventionList); GetGameState().EditorStep = EditorStep::InventionsListSetUp; } @@ -222,7 +231,9 @@ namespace OpenRCT2::Ui::Windows void JumpForwardToOptionsSelection() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + ContextOpenWindow(WindowClass::EditorScenarioOptions); GetGameState().EditorStep = EditorStep::OptionsSelection; GfxInvalidateScreen(); @@ -230,7 +241,9 @@ namespace OpenRCT2::Ui::Windows void JumpForwardToObjectiveSelection() const { - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); GetGameState().EditorStep = EditorStep::ObjectiveSelection; GfxInvalidateScreen(); @@ -247,7 +260,8 @@ namespace OpenRCT2::Ui::Windows return; } - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); auto intent = Intent(WindowClass::Loadsave); intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); intent.PutExtra(INTENT_EXTRA_PATH, gameState.ScenarioName); diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index cf05cc2111b6..142767d08fcd 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -691,7 +691,7 @@ namespace OpenRCT2::Ui::Windows ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { auto* windowMgr = Ui::GetWindowManager(); - WindowCloseByClass(WindowClass::EditorInventionListDrag); + windowMgr->CloseByClass(WindowClass::EditorInventionListDrag); auto* wnd = windowMgr->Create( WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); if (wnd != nullptr) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index d38d0153899d..0b373f10a50f 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -602,7 +602,8 @@ namespace OpenRCT2::Ui::Windows { // Used for in-game object selection cheat to prevent crashing the game // when windows attempt to draw objects that don't exist any more - WindowCloseAllExceptClass(WindowClass::EditorObjectSelection); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAllExceptClass(WindowClass::EditorObjectSelection); int32_t selected_object = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); if (selected_object == -1) @@ -1737,16 +1738,17 @@ namespace OpenRCT2::Ui::Windows bool EditorObjectSelectionWindowCheck() { + auto* windowMgr = Ui::GetWindowManager(); + auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); if (missingObjectType == ObjectType::None) { - WindowCloseByClass(WindowClass::EditorObjectSelection); + windowMgr->CloseByClass(WindowClass::EditorObjectSelection); return true; } ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); - auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByClass(WindowClass::EditorObjectSelection); if (w != nullptr) { diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 76edebfcebfc..f07afefe44b5 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -368,7 +368,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -670,7 +670,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_TAB_1: case WIDX_TAB_2: @@ -916,7 +916,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_TAB_1: case WIDX_TAB_2: diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 4bb7d73e89b6..cf86b14ee35e 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -121,7 +121,8 @@ namespace OpenRCT2::Ui::Windows } // Close any existing error windows if they exist. - WindowCloseByClass(WindowClass::Error); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Error); // How wide is the error string? int32_t width = GfxGetStringWidthNewLined(buffer.data(), FontStyle::Medium); @@ -140,7 +141,6 @@ namespace OpenRCT2::Ui::Windows auto errorWindow = std::make_unique(std::move(buffer), numLines, autoClose); - auto* windowMgr = GetWindowManager(); return windowMgr->Create( std::move(errorWindow), WindowClass::Error, windowPosition, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 1c9f2ceafa52..d25f948d14f4 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1733,7 +1733,7 @@ namespace OpenRCT2::Ui::Windows else { ToolCancel(); - WindowCloseByClass(WindowClass::Footpath); + windowMgr->CloseByClass(WindowClass::Footpath); } } diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 2eb95ef92ee6..74814047bba5 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -421,8 +421,9 @@ namespace OpenRCT2::Ui::Windows return nullptr; } - WindowCloseByClass(WindowClass::EditorObjectSelection); - WindowCloseConstructionWindows(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::EditorObjectSelection); + windowMgr->CloseConstructionWindows(); gTrackDesignSceneryToggle = false; _currentTrackPieceDirection = 2; @@ -431,7 +432,6 @@ namespace OpenRCT2::Ui::Windows int32_t screenHeight = ContextGetHeight(); auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(kTopToolbarHeight + 1, screenHeight / 2 - 200) }; - auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); window->SetupTrack(path, std::move(trackDesign)); diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index a0339a1fc20e..1b33d21c7723 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -293,8 +293,9 @@ namespace OpenRCT2::Ui::Windows // Closing this will cause a Ride window to pop up, so we have to do this to ensure that // no windows are open (besides the toolbars and LoadSave window). - WindowCloseByClass(WindowClass::RideConstruction); - WindowCloseAllExceptClass(WindowClass::Loadsave); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::RideConstruction); + windowMgr->CloseAllExceptClass(WindowClass::Loadsave); auto& gameState = GetGameState(); @@ -305,7 +306,7 @@ namespace OpenRCT2::Ui::Windows if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer)) { InvokeCallback(MODAL_RESULT_OK, pathBuffer); - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); } else @@ -325,7 +326,7 @@ namespace OpenRCT2::Ui::Windows gIsAutosaveLoaded = false; gFirstTimeSaving = false; - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); InvokeCallback(MODAL_RESULT_OK, pathBuffer); @@ -359,7 +360,7 @@ namespace OpenRCT2::Ui::Windows if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2)) { gCurrentLoadedPath = pathBuffer; - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); GfxInvalidateScreen(); InvokeCallback(MODAL_RESULT_OK, pathBuffer); } @@ -382,7 +383,7 @@ namespace OpenRCT2::Ui::Windows if (success) { - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); auto* context = OpenRCT2::GetContext(); @@ -403,7 +404,7 @@ namespace OpenRCT2::Ui::Windows auto intent = Intent(WindowClass::InstallTrack); intent.PutExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); ContextOpenIntent(&intent); - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); break; } @@ -421,7 +422,7 @@ namespace OpenRCT2::Ui::Windows if (success) { - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); WindowRideMeasurementsDesignCancel(); InvokeCallback(MODAL_RESULT_OK, path); } @@ -434,7 +435,7 @@ namespace OpenRCT2::Ui::Windows } case (LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP): - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::Loadsave); InvokeCallback(MODAL_RESULT_OK, pathBuffer); break; } @@ -769,7 +770,10 @@ namespace OpenRCT2::Ui::Windows void OnClose() override { _listItems.clear(); - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::LoadsaveOverwritePrompt); + Config::Save(); // Unpause the game if not on title scene, nor in network play. @@ -1457,7 +1461,8 @@ namespace OpenRCT2::Ui::Windows // As the LoadSaveWindow::Select function can change the order of the // windows we can't use WindowClose(w). - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::LoadsaveOverwritePrompt); break; } @@ -1483,9 +1488,9 @@ namespace OpenRCT2::Ui::Windows static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path) { - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::LoadsaveOverwritePrompt); - auto* windowMgr = GetWindowManager(); return windowMgr->Create( WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name, path); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b594ba5aa042..10c3d4fb0c48 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -286,7 +286,7 @@ namespace OpenRCT2::Ui::Windows if (!windowMgr->FindByClass(WindowClass::LandRights)) ContextOpenWindow(WindowClass::LandRights); else - WindowCloseByClass(WindowClass::LandRights); + windowMgr->CloseByClass(WindowClass::LandRights); break; } case WIDX_BUILD_PARK_ENTRANCE: @@ -294,7 +294,7 @@ namespace OpenRCT2::Ui::Windows if (!windowMgr->FindByClass(WindowClass::EditorParkEntrance)) ContextOpenWindow(WindowClass::EditorParkEntrance); else - WindowCloseByClass(WindowClass::EditorParkEntrance); + windowMgr->CloseByClass(WindowClass::EditorParkEntrance); break; } case WIDX_PEOPLE_STARTING_POSITION: diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index cb644ed12661..274595d1688a 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -100,7 +100,8 @@ namespace OpenRCT2::Ui::Windows if (_cursorHoldDuration < 25 || stringId == kStringIdNone || im.IsModifierKeyPressed(ModifierKey::ctrl) || im.IsModifierKeyPressed(ModifierKey::shift) || wm->FindByClass(WindowClass::Error) != nullptr) { - WindowCloseByClass(WindowClass::MapTooltip); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::MapTooltip); } else { diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 0f35508d4285..09ce4330f751 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -370,7 +370,10 @@ namespace OpenRCT2::Ui::Windows { ToolCancel(); if (!currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) - WindowCloseByClass(WindowClass::RideConstruction); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::RideConstruction); + } } else { diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 765b015a720a..2b8a1d3d6fc7 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -279,7 +279,8 @@ namespace OpenRCT2::Ui::Windows gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - WindowCloseByClass(WindowClass::NewCampaign); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::NewCampaign); } }); GameActions::Execute(&gameAction); @@ -409,7 +410,7 @@ namespace OpenRCT2::Ui::Windows if (w->GetCampaignType() == campaignType) return w; - WindowClose(*w); + w->Close(); } w = windowMgr->Create(WindowClass::NewCampaign, WW, WH, 0); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 585b1dccd5d0..80a0bedaf7dd 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -562,7 +562,9 @@ namespace OpenRCT2::Ui::Windows } Close(); - WindowCloseConstructionWindows(); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseConstructionWindows(); auto count = GetNumTrackDesigns(item); if (count > 0) @@ -1077,8 +1079,8 @@ namespace OpenRCT2::Ui::Windows return window; } - WindowCloseByClass(WindowClass::TrackDesignList); - WindowCloseByClass(WindowClass::TrackDesignPlace); + windowMgr->CloseByClass(WindowClass::TrackDesignList); + windowMgr->CloseByClass(WindowClass::TrackDesignPlace); window = windowMgr->Create( WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 3f2d0d2bcf75..a9aa85935296 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -415,7 +415,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); return; case WIDX_COPY_CURRENT: if (selected_list_item > -1 && selected_list_item < no_list_items) diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 103ffedc869f..a101dce016f4 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -620,7 +620,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_TAB_DISPLAY: case WIDX_TAB_RENDERING: @@ -1698,10 +1698,13 @@ namespace OpenRCT2::Ui::Windows Invalidate(); break; case WIDX_SCENARIO_UNLOCKING: + { Config::Get().general.ScenarioUnlockingEnabled ^= 1; Config::Save(); - WindowCloseByClass(WindowClass::ScenarioSelect); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ScenarioSelect); break; + } case WIDX_AUTO_OPEN_SHOPS: Config::Get().general.AutoOpenShops = !Config::Get().general.AutoOpenShops; Config::Save(); @@ -1820,7 +1823,8 @@ namespace OpenRCT2::Ui::Windows Config::Get().interface.ScenarioselectLastTab = 0; Config::Save(); Invalidate(); - WindowCloseByClass(WindowClass::ScenarioSelect); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ScenarioSelect); } break; } diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index ac48088e42dd..fd32058dfebf 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -107,7 +107,8 @@ namespace OpenRCT2::Ui::Windows if (w != nullptr) { auto windowPos = w->windowPos; - WindowClose(*w); + windowMgr->Close(*w); + newWindow = windowMgr->Create( WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 6e97dd41b12d..9c2d1bf3c99e 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1140,7 +1140,7 @@ namespace OpenRCT2::Ui::Windows auto constructionWindow = windowMgr->FindByClass(WindowClass::RideConstruction); if (constructionWindow != nullptr && constructionWindow->number == number) { - WindowCloseByClass(WindowClass::RideConstruction); + windowMgr->CloseByClass(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 SetPage(WINDOW_RIDE_PAGE_VEHICLE); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 90c83cde77ad..003731f04349 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -214,7 +214,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(WindowClass::Ride, rideId.ToUnderlying()); if (w != nullptr && w->page == 1) - WindowClose(*w); + windowMgr->Close(*w); } static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); @@ -2595,7 +2595,8 @@ namespace OpenRCT2::Ui::Windows ToolCancel(); if (!currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { - WindowCloseByClass(WindowClass::RideConstruction); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::RideConstruction); } } else @@ -2827,7 +2828,7 @@ namespace OpenRCT2::Ui::Windows { if (RideAreAllPossibleEntrancesAndExitsBuilt(ride).Successful) { - WindowClose(*w); + windowMgr->Close(*w); } else { @@ -2900,7 +2901,8 @@ namespace OpenRCT2::Ui::Windows WindowRideConstructionUpdateActiveElements(); } - WindowCloseByClass(WindowClass::Error); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Error); if (ride != nullptr) CloseConstructWindowOnCompletion(*ride); } @@ -2944,7 +2946,8 @@ namespace OpenRCT2::Ui::Windows WindowRideConstructionUpdateActiveElements(); } - WindowCloseByClass(WindowClass::Error); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Error); if (ride != nullptr) CloseConstructWindowOnCompletion(*ride); } @@ -3661,7 +3664,7 @@ namespace OpenRCT2::Ui::Windows } else { - WindowCloseByClass(WindowClass::Error); + windowMgr->CloseByClass(WindowClass::Error); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, _currentTrackBegin); break; } diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 0dfdfbb79e9f..eb85f761828a 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -231,7 +231,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_SORT: list_information_type = _windowRideListInformationType; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index d217caba43e2..baef73205628 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -236,7 +236,7 @@ namespace OpenRCT2::Ui::Windows auto* window = windowMgr->BringToFrontByClass(WindowClass::SavePrompt); if (window != nullptr) { - WindowClose(*window); + windowMgr->Close(*window); } if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels)) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index b445c2be32f0..b56296791273 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -253,7 +253,10 @@ namespace OpenRCT2::Ui::Windows ViewportSetVisibility(ViewportVisibility::Default); if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::SceneryScatter); + } if (isToolActive(WindowClass::Scenery)) ToolCancel(); @@ -261,6 +264,8 @@ namespace OpenRCT2::Ui::Windows void OnMouseUp(WidgetIndex widgetIndex) override { + auto* windowMgr = Ui::GetWindowManager(); + switch (widgetIndex) { case WIDX_SCENERY_CLOSE: @@ -276,14 +281,14 @@ namespace OpenRCT2::Ui::Windows _sceneryPaintEnabled ^= true; gWindowSceneryEyedropperEnabled = false; if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); + windowMgr->CloseByClass(WindowClass::SceneryScatter); Invalidate(); break; case WIDX_SCENERY_EYEDROPPER_BUTTON: _sceneryPaintEnabled = false; gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); + windowMgr->CloseByClass(WindowClass::SceneryScatter); SceneryRemoveGhostToolPlacement(); Invalidate(); break; @@ -291,7 +296,7 @@ namespace OpenRCT2::Ui::Windows _sceneryPaintEnabled = false; gWindowSceneryEyedropperEnabled = false; if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); + windowMgr->CloseByClass(WindowClass::SceneryScatter); else if ( NetworkGetMode() != NETWORK_MODE_CLIENT || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)) diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 749cea1a9a77..2472cc5b16cb 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -96,7 +96,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_PREVIEW: diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 75f54a5bbbfe..d59175955f27 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -81,7 +81,7 @@ namespace OpenRCT2::Ui::Windows if (registeredShortcut != nullptr) { auto* windowMgr = GetWindowManager(); - WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); + windowMgr->CloseByClass(WindowClass::ChangeKeyboardShortcut); auto* w = windowMgr->Create( WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); if (w != nullptr) @@ -198,7 +198,8 @@ namespace OpenRCT2::Ui::Windows void OnClose() override { - WindowCloseByClass(WindowClass::ResetShortcutKeysPrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ResetShortcutKeysPrompt); } void OnResize() override diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 40ee43cebfce..e0b4b548e6af 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -470,7 +470,8 @@ namespace OpenRCT2::Ui::Windows return; } - WindowCloseByClass(WindowClass::PatrolArea); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::PatrolArea); auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( staff->Id, {}, StaffSetPatrolAreaMode::ClearAll); @@ -481,7 +482,8 @@ namespace OpenRCT2::Ui::Windows auto staffId = EntityId::FromUnderlying(number); if (WindowPatrolAreaGetCurrentStaffId() == staffId) { - WindowCloseByClass(WindowClass::PatrolArea); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::PatrolArea); } else { diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 0a08a593b976..dbca27e43aaa 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -136,7 +136,7 @@ namespace OpenRCT2::Ui::Windows auto parentWindow = GetParentWindow(); if (parentWindow == nullptr) { - WindowClose(*this); + Close(); return; } } @@ -157,12 +157,12 @@ namespace OpenRCT2::Ui::Windows case WIDX_CLOSE: ContextStopTextInput(); ExecuteCallback(false); - WindowClose(*this); + Close(); break; case WIDX_OKAY: ContextStopTextInput(); ExecuteCallback(true); - WindowClose(*this); + Close(); } } @@ -301,7 +301,7 @@ namespace OpenRCT2::Ui::Windows { ContextStopTextInput(); ExecuteCallback(true); - WindowClose(*this); + Close(); } static int32_t CalculateWindowHeight(std::string_view text) @@ -374,7 +374,7 @@ namespace OpenRCT2::Ui::Windows const_utf8string existing_text, int32_t maxLength) { auto* windowMgr = GetWindowManager(); - WindowCloseByClass(WindowClass::Textinput); + windowMgr->CloseByClass(WindowClass::Textinput); auto height = TextInputWindow::CalculateWindowHeight(existing_text); auto w = windowMgr->Create(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 433fec9fa83f..0f9926c08522 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -132,8 +132,8 @@ namespace OpenRCT2::Ui::Windows } else { - WindowCloseByClass(WindowClass::Loadsave); - WindowCloseByClass(WindowClass::ServerList); + windowMgr->CloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::ServerList); ScenarioselectOpen(WindowTitleMenuScenarioselectCallback); } break; @@ -145,8 +145,8 @@ namespace OpenRCT2::Ui::Windows } else { - WindowCloseByClass(WindowClass::ScenarioSelect); - WindowCloseByClass(WindowClass::ServerList); + windowMgr->CloseByClass(WindowClass::ScenarioSelect); + windowMgr->CloseByClass(WindowClass::ServerList); auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); GameActions::Execute(&loadOrQuitAction); } @@ -159,8 +159,8 @@ namespace OpenRCT2::Ui::Windows } else { - WindowCloseByClass(WindowClass::ScenarioSelect); - WindowCloseByClass(WindowClass::Loadsave); + windowMgr->CloseByClass(WindowClass::ScenarioSelect); + windowMgr->CloseByClass(WindowClass::Loadsave); ContextOpenWindow(WindowClass::ServerList); } break; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index bd67b7fa7cf2..f00a89a8bec5 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -204,7 +204,9 @@ namespace OpenRCT2::Ui::Windows void WindowTooltipClose() { - WindowCloseByClass(WindowClass::Tooltip); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Tooltip); + gTooltipCloseTimeout = 0; gTooltipWidget.window_classification = WindowClass::Null; } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index cbf749c37fa1..e88ecf3560ff 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -500,8 +500,9 @@ namespace OpenRCT2::Ui::Windows break; case DDIDX_QUIT_TO_MENU: { - WindowCloseByClass(WindowClass::ManageTrackDesign); - WindowCloseByClass(WindowClass::TrackDeletePrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ManageTrackDesign); + windowMgr->CloseByClass(WindowClass::TrackDeletePrompt); auto loadOrQuitAction = LoadOrQuitAction( LoadOrQuitModes::OpenSavePrompt, PromptMode::SaveBeforeQuit); GameActions::Execute(&loadOrQuitAction); @@ -1474,9 +1475,12 @@ namespace OpenRCT2::Ui::Windows ContextOpenWindow(WindowClass::TileInspector); break; case DDIDX_OBJECT_SELECTION: - WindowCloseAll(); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); ContextOpenWindow(WindowClass::EditorObjectSelection); break; + } case DDIDX_INVENTIONS_LIST: ContextOpenWindow(WindowClass::EditorInventionList); break; @@ -1535,7 +1539,7 @@ namespace OpenRCT2::Ui::Windows } else { - WindowCloseByClass(WindowClass::DebugPaint); + windowMgr->CloseByClass(WindowClass::DebugPaint); } break; } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 3bd1a85b481c..b9a9d31bc324 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -108,10 +108,10 @@ namespace OpenRCT2::Ui::Windows */ WindowBase* TrackManageOpen(TrackDesignFileRef* tdFileRef) { - WindowCloseByClass(WindowClass::ManageTrackDesign); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ManageTrackDesign); auto trackDesignManageWindow = std::make_unique(tdFileRef); - auto* windowMgr = GetWindowManager(); auto* window = windowMgr->Create( std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); @@ -137,9 +137,12 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowCloseByClass(WindowClass::TrackDeletePrompt); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::TrackDeletePrompt); Close(); break; + } case WIDX_RENAME: WindowTextInputRawOpen( this, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, @@ -170,7 +173,8 @@ namespace OpenRCT2::Ui::Windows if (TrackRepositoryRename(_trackDesignFileReference->path, std::string(text))) { - WindowCloseByClass(WindowClass::TrackDeletePrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::TrackDeletePrompt); Close(); WindowTrackDesignListReloadTracks(); } @@ -192,13 +196,13 @@ namespace OpenRCT2::Ui::Windows */ static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef) { - WindowCloseByClass(WindowClass::TrackDeletePrompt); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::TrackDeletePrompt); int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); auto trackDeletePromptWindow = std::make_unique(tdFileRef); - auto* windowMgr = GetWindowManager(); windowMgr->Create( std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, ScreenCoordsXY( @@ -226,7 +230,8 @@ namespace OpenRCT2::Ui::Windows Close(); if (TrackRepositoryDelete(tdPath)) { - WindowCloseByClass(WindowClass::ManageTrackDesign); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::ManageTrackDesign); WindowTrackDesignListReloadTracks(); } else diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 8f7d521ccf15..077be124d63a 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -295,19 +295,19 @@ namespace OpenRCT2::Ui::Windows auto getRide = GetRide(rideId); if (getRide != nullptr) { - WindowCloseByClass(WindowClass::Error); - Audio::Play3D(Audio::SoundId::PlaceItem, trackLoc); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Error); + Audio::Play3D(Audio::SoundId::PlaceItem, trackLoc); _currentRideIndex = rideId; - auto* windowMgr = GetWindowManager(); if (TrackDesignAreEntranceAndExitPlaced()) { auto intent = Intent(WindowClass::Ride); intent.PutExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying()); ContextOpenIntent(&intent); auto* wnd = windowMgr->FindByClass(WindowClass::TrackDesignPlace); - WindowClose(*wnd); + windowMgr->Close(*wnd); } else { @@ -734,9 +734,9 @@ namespace OpenRCT2::Ui::Windows return nullptr; } - WindowCloseConstructionWindows(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseConstructionWindows(); - auto* windowMgr = GetWindowManager(); auto* window = windowMgr->FocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); if (window != nullptr) { diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 29f1222217bc..3c6fecf0dfcd 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -265,8 +265,9 @@ namespace OpenRCT2::Ui::Windows // try to load the track manager again, and an infinite loop will result. if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && gScreenAge != 0) { - WindowCloseByNumber(WindowClass::ManageTrackDesign, number); - WindowCloseByNumber(WindowClass::TrackDeletePrompt, number); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::ManageTrackDesign, number); + windowMgr->CloseByNumber(WindowClass::TrackDeletePrompt, number); Editor::LoadTrackManager(); } } @@ -757,7 +758,9 @@ namespace OpenRCT2::Ui::Windows WindowBase* TrackListOpen(const RideSelection item) { - WindowCloseConstructionWindows(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseConstructionWindows(); + ScreenCoordsXY screenPos{}; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { @@ -769,7 +772,7 @@ namespace OpenRCT2::Ui::Windows { screenPos = { 0, kTopToolbarHeight + 2 }; } - auto* windowMgr = GetWindowManager(); + return windowMgr->Create(WindowClass::TrackDesignList, WW, WH, 0, item); } diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 06f9d467dc5d..b1e75e7c1deb 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + Close(); break; case WIDX_CLIP_CHECKBOX_ENABLE: { diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 290f18239a46..64b7e7b8acfc 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -209,7 +209,9 @@ namespace OpenRCT2 #ifndef DISABLE_NETWORK _network.Close(); #endif - WindowCloseAll(); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); // Unload objects after closing all windows, this is to overcome windows like // the object selection window which loads objects when closed. diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 67089f25a50f..4387ba5cee5c 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -245,7 +245,8 @@ namespace OpenRCT2::Editor { // #4996: Make sure the object selection window closes here to prevent unload objects // after we have loaded a new park. - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); if (!GetContext()->LoadParkFromFile(path)) return false; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 4c6d5032f55a..dd075a1ecb1a 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -615,7 +615,10 @@ static void GameLoadOrQuitNoSavePromptCallback(int32_t result, const utf8* path) { GameNotifyMapChange(); GameUnloadScripts(); - WindowCloseByClass(WindowClass::EditorObjectSelection); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::EditorObjectSelection); + GameLoadScripts(); GameNotifyMapChanged(); gIsAutosaveLoaded = gIsAutosave; @@ -627,8 +630,9 @@ static void NewGameWindowCallback(const utf8* path) { // Closing this will cause a Ride window to pop up, so we have to do this to ensure that // no windows are open (besides the toolbars and LoadSave window). - WindowCloseByClass(WindowClass::RideConstruction); - WindowCloseAllExceptClass(WindowClass::Loadsave); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::RideConstruction); + windowMgr->CloseAllExceptClass(WindowClass::Loadsave); GameNotifyMapChange(); GetContext()->LoadParkFromFile(path, false, true); diff --git a/src/openrct2/actions/LoadOrQuitAction.cpp b/src/openrct2/actions/LoadOrQuitAction.cpp index a6234e027386..e45fbdd81cd4 100644 --- a/src/openrct2/actions/LoadOrQuitAction.cpp +++ b/src/openrct2/actions/LoadOrQuitAction.cpp @@ -11,6 +11,7 @@ #include "../Context.h" #include "../OpenRCT2.h" +#include "../ui/WindowManager.h" using namespace OpenRCT2; @@ -53,8 +54,11 @@ GameActions::Result LoadOrQuitAction::Execute() const ContextOpenWindow(WindowClass::SavePrompt); break; case LoadOrQuitModes::CloseSavePrompt: - WindowCloseByClass(WindowClass::SavePrompt); + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::SavePrompt); break; + } default: GameLoadOrQuitNoSavePrompt(); break; diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 165f7b8d9f8b..0ae10ba25966 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -160,10 +160,11 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const GetGameState().Park.Value = Park::CalculateParkValue(); // Close windows related to the demolished ride - WindowCloseByNumber(WindowClass::RideConstruction, rideId.ToUnderlying()); - WindowCloseByNumber(WindowClass::Ride, rideId.ToUnderlying()); - WindowCloseByNumber(WindowClass::DemolishRidePrompt, rideId.ToUnderlying()); - WindowCloseByClass(WindowClass::NewCampaign); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::RideConstruction, rideId.ToUnderlying()); + windowMgr->CloseByNumber(WindowClass::Ride, rideId.ToUnderlying()); + windowMgr->CloseByNumber(WindowClass::DemolishRidePrompt, rideId.ToUnderlying()); + windowMgr->CloseByClass(WindowClass::NewCampaign); // Refresh windows that display the ride name auto windowManager = OpenRCT2::Ui::GetWindowManager(); @@ -288,7 +289,8 @@ GameActions::Result RideDemolishAction::RefurbishRide(Ride& ride) const res.Position = { location, TileElementHeight(location) }; } - WindowCloseByNumber(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying()); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying()); return res; } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index e6b5eced97ad..d6a0fb927db3 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -206,7 +206,7 @@ GameActions::Result RideSetStatusAction::Execute() const WindowBase* constructionWindow = windowMgr->FindByNumber(WindowClass::RideConstruction, _rideIndex.ToUnderlying()); if (constructionWindow != nullptr) { - WindowClose(*constructionWindow); + windowMgr->Close(*constructionWindow); } if (_status == RideStatus::Testing) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index acb171908677..f263de668e60 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -13,6 +13,7 @@ #include "../entity/EntityRegistry.h" #include "../entity/Staff.h" #include "../interface/Window.h" +#include "../ui/WindowManager.h" using namespace OpenRCT2; @@ -73,9 +74,13 @@ GameActions::Result StaffFireAction::Execute() const LOG_ERROR("Staff entity not found for spriteId %u", _spriteId); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } - WindowCloseByClass(WindowClass::FirePrompt); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::FirePrompt); + PeepEntityRemove(staff); // Due to patrol areas best to invalidate the whole screen on removal of staff GfxInvalidateScreen(); + return GameActions::Result(); } diff --git a/src/openrct2/command_line/ConvertCommand.cpp b/src/openrct2/command_line/ConvertCommand.cpp index 1bec66b46049..71632e3fb0d6 100644 --- a/src/openrct2/command_line/ConvertCommand.cpp +++ b/src/openrct2/command_line/ConvertCommand.cpp @@ -18,6 +18,7 @@ #include "../object/ObjectManager.h" #include "../park/ParkFile.h" #include "../scenario/Scenario.h" +#include "../ui/WindowManager.h" #include "CommandLine.hpp" #include @@ -123,7 +124,8 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato // HACK remove the main window so it saves the park with the // correct initial view - WindowCloseByClass(WindowClass::MainWindow); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::MainWindow); exporter->Export(gameState, destinationPath); } diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index c1e756056187..109f720b0999 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -720,9 +720,9 @@ void PeepEntityRemove(Peep* peep) } peep->Invalidate(); - WindowCloseByNumber(WindowClass::Peep, peep->Id); - - WindowCloseByNumber(WindowClass::FirePrompt, EnumValue(peep->Type)); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::Peep, peep->Id); + windowMgr->CloseByNumber(WindowClass::FirePrompt, EnumValue(peep->Type)); auto* staff = peep->As(); // Needed for invalidations after sprite removal diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 00e086b554c8..fd92cd1fe7b5 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -61,6 +61,7 @@ #include "../ride/RideData.h" #include "../ride/RideManager.hpp" #include "../ride/Vehicle.h" +#include "../ui/WindowManager.h" #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Climate.h" @@ -1207,7 +1208,8 @@ static void ConsoleCommandOpen(InteractiveConsole& console, const arguments_t& a else { // Only this window should be open for safety reasons - WindowCloseAll(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAll(); ContextOpenWindow(WindowClass::EditorObjectSelection); } } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 80463d2fe43f..18a51fd47099 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -77,12 +77,6 @@ static constexpr float kWindowScrollLocations[][2] = { }; // clang-format on - namespace WindowCloseFlags - { - static constexpr uint32_t None = 0; - static constexpr uint32_t CloseSingle = (1 << 0); - } // namespace WindowCloseFlags - static void WindowDrawCore(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom); static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom); @@ -174,36 +168,6 @@ static constexpr float kWindowScrollLocations[][2] = { WindowVisitEach([&](WindowBase* w) { w->OnLanguageChange(); }); } - static void WindowCloseSurplus(int32_t cap, WindowClass avoid_classification) - { - // find the amount of windows that are currently open - auto count = static_cast(g_window_list.size()); - // difference between amount open and cap = amount to close - auto diff = count - kWindowLimitReserved - cap; - for (auto i = 0; i < diff; i++) - { - // iterates through the list until it finds the newest window, or a window that can be closed - WindowBase* foundW{}; - for (auto& w : g_window_list) - { - if (w->flags & WF_DEAD) - continue; - if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) - { - foundW = w.get(); - break; - } - } - // skip window if window matches specified WindowClass (as user may be modifying via options) - if (avoid_classification != WindowClass::Null && foundW != nullptr - && foundW->classification == avoid_classification) - { - continue; - } - WindowClose(*foundW); - } - } - /* * Changes the maximum amount of windows allowed */ @@ -217,134 +181,9 @@ static constexpr float kWindowScrollLocations[][2] = { // windows if one sets a limit lower than the number of windows open if (val < prev) { - WindowCloseSurplus(val, WindowClass::Options); - } - } - - /** - * Closes the specified window. - * rct2: 0x006ECD4C - * - * @param window The window to close (esi). - */ - void WindowClose(WindowBase& w) - { - w.OnClose(); - - // Remove viewport - w.RemoveViewport(); - - // Invalidate the window (area) - w.Invalidate(); - - w.flags |= WF_DEAD; - } - - template - static void WindowCloseByCondition(TPred pred, uint32_t flags = WindowCloseFlags::None) - { - for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); ++it) - { - auto& wnd = *(*it); - if (wnd.flags & WF_DEAD) - continue; - - if (pred(&wnd)) - { - WindowClose(wnd); - if (flags & WindowCloseFlags::CloseSingle) - { - return; - } - } - } - } - - /** - * Closes all windows with the specified window class. - * rct2: 0x006ECCF4 - * @param cls (cl) with bit 15 set - */ - void WindowCloseByClass(WindowClass cls) - { - WindowCloseByCondition([&](WindowBase* w) -> bool { return w->classification == cls; }); - } - - /** - * Closes all windows with specified window class and number. - * rct2: 0x006ECCF4 - * @param cls (cl) without bit 15 set - * @param number (dx) - */ - void WindowCloseByNumber(WindowClass cls, rct_windownumber number) - { - WindowCloseByCondition( - [cls, number](WindowBase* w) -> bool { return w->classification == cls && w->number == number; }); - } - - // TODO: Refactor this to use variant once the new window class is done. - void WindowCloseByNumber(WindowClass cls, EntityId number) - { - WindowCloseByNumber(cls, static_cast(number.ToUnderlying())); - } - - /** - * Closes the top-most window - * - * rct2: 0x006E403C - */ - void WindowCloseTop() - { - WindowCloseByClass(WindowClass::Dropdown); - - if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - { - if (GetGameState().EditorStep != EditorStep::LandscapeEditor) - return; + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseSurplus(val, WindowClass::Options); } - - auto pred = [](WindowBase* w) -> bool { return !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); }; - WindowCloseByCondition(pred, WindowCloseFlags::CloseSingle); - } - - /** - * Closes all open windows - * - * rct2: 0x006EE927 - */ - void WindowCloseAll() - { - WindowCloseByClass(WindowClass::Dropdown); - WindowCloseByCondition([](WindowBase* w) -> bool { return !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); }); - } - - void WindowCloseAllExceptClass(WindowClass cls) - { - WindowCloseByClass(WindowClass::Dropdown); - WindowCloseByCondition([cls](WindowBase* w) -> bool { - return w->classification != cls && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)); - }); - } - - /** - * Closes all windows, save for those having any of the passed flags. - */ - void WindowCloseAllExceptFlags(uint16_t flags) - { - WindowCloseByCondition([flags](WindowBase* w) -> bool { return !(w->flags & flags); }); - } - - /** - * Closes all windows except the specified window number and class. - * @param number (dx) - * @param cls (cl) without bit 15 set - */ - void WindowCloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls) - { - WindowCloseByClass(WindowClass::Dropdown); - WindowCloseByCondition([cls, number](WindowBase* w) -> bool { - return (!(w->number == number && w->classification == cls) && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))); - }); } /** @@ -1084,18 +923,6 @@ static constexpr float kWindowScrollLocations[][2] = { } } - /** - * - * rct2: 0x006CBCC3 - */ - void WindowCloseConstructionWindows() - { - 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 @@ -1131,7 +958,8 @@ static constexpr float kWindowScrollLocations[][2] = { */ void TextinputCancel() { - WindowCloseByClass(WindowClass::Textinput); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Textinput); } bool WindowIsVisible(WindowBase& w) @@ -1235,7 +1063,8 @@ static constexpr float kWindowScrollLocations[][2] = { void WindowInitAll() { - WindowCloseAllExceptFlags(0); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseAllExceptFlags(0); } void WindowFollowSprite(WindowBase& w, EntityId spriteIndex) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index b58a62431de1..3271e7645b0d 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -380,15 +380,6 @@ namespace OpenRCT2 void WindowSetWindowLimit(int32_t value); - void WindowClose(WindowBase& 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); void WindowInvalidateByClass(WindowClass cls); void WindowInvalidateByNumber(WindowClass cls, rct_windownumber number); void WindowInvalidateByNumber(WindowClass cls, EntityId id); @@ -422,8 +413,6 @@ namespace OpenRCT2 bool ToolSet(const WindowBase& w, WidgetIndex widgetIndex, Tool tool); void ToolCancel(); - void WindowCloseConstructionWindows(); - void WindowUpdateViewportRideMusic(); Viewport* WindowGetViewport(WindowBase* window); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7a736e0f1521..7bc6229ef402 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -649,7 +649,9 @@ void NetworkBase::UpdateClient() intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string{ str_disconnected }); ContextOpenIntent(&intent); } - WindowCloseByClass(WindowClass::Multiplayer); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Multiplayer); Close(); } else diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 6ca2b10908f7..4020106c61fd 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -17,10 +17,10 @@ #include "../core/EnumUtils.hpp" #include "../core/JobPool.h" #include "../core/Memory.hpp" -#include "../interface/Window.h" #include "../localisation/StringIds.h" #include "../ride/Ride.h" #include "../ride/RideAudio.h" +#include "../ui/WindowManager.h" #include "BannerSceneryEntry.h" #include "LargeSceneryObject.h" #include "Object.h" @@ -503,10 +503,6 @@ class ObjectManager final : public IObjectManager sgObject->UpdateEntryIndexes(); } } - - // 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 - WindowCloseByClass(WindowClass::Scenery); } ObjectEntryIndex GetPrimarySceneryGroupEntryIndex(Object* loadedObject) diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 661d86b6e7e8..2c6ac17179b0 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -52,7 +52,7 @@ #include "../scenario/Scenario.h" #include "../scenario/ScenarioRepository.h" #include "../scripting/ScriptEngine.h" -#include "../ui/UiContext.h" +#include "../ui/WindowManager.h" #include "../world/Climate.h" #include "../world/Entrance.h" #include "../world/Map.h" @@ -2643,7 +2643,8 @@ int32_t ScenarioSave(GameState_t& gameState, u8string_view path, int32_t flags) gIsAutosave = flags & S6_SAVE_FLAG_AUTOMATIC; if (!gIsAutosave) { - WindowCloseConstructionWindows(); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseConstructionWindows(); } PrepareMapForSave(); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 7ac809134afa..b4e8ebe95064 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -4030,7 +4030,8 @@ ResultWithMessage Ride::Test(bool isApplying) return { false }; } - WindowCloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); StationIndex stationIndex = {}; auto message = ChangeStatusDoStationChecks(stationIndex); @@ -4117,7 +4118,8 @@ ResultWithMessage Ride::Open(bool isApplying) // with auto open on. if (isToolActive(WindowClass::RideConstruction, static_cast(id.ToUnderlying()))) { - WindowCloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); } StationIndex stationIndex = {}; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 21f07a6a0662..345a49530a84 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -52,6 +52,7 @@ #include "../ride/Ride.h" #include "../ride/RideManager.hpp" #include "../ride/Track.h" +#include "../ui/WindowManager.h" #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Climate.h" @@ -173,8 +174,11 @@ void ScenarioReset(GameState_t& gameState) static void ScenarioEnd() { GameResetSpeed(); - WindowCloseByClass(WindowClass::Dropdown); - WindowCloseAllExceptFlags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); + + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByClass(WindowClass::Dropdown); + windowMgr->CloseAllExceptFlags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); + ContextOpenWindowView(WV_PARK_OBJECTIVE); } diff --git a/src/openrct2/ui/DummyWindowManager.cpp b/src/openrct2/ui/DummyWindowManager.cpp index 7b5b848bafd4..9105d7b0da3d 100644 --- a/src/openrct2/ui/DummyWindowManager.cpp +++ b/src/openrct2/ui/DummyWindowManager.cpp @@ -77,6 +77,18 @@ namespace OpenRCT2::Ui return nullptr; } + void Close(WindowBase& window) override {}; + void CloseSurplus(int32_t cap, WindowClass avoid_classification) override {}; + void CloseByClass(WindowClass cls) override {}; + void CloseByNumber(WindowClass cls, rct_windownumber number) override {}; + void CloseByNumber(WindowClass cls, EntityId number) override {}; + void CloseTop() override {}; + void CloseAll() override {}; + void CloseAllExceptClass(WindowClass cls) override {}; + void CloseAllExceptFlags(uint16_t flags) override {}; + void CloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls) override {}; + void CloseConstructionWindows() override {}; + WindowBase* FindByClass(WindowClass cls) override { return nullptr; diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index de4049863139..515e0fa3b581 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -84,6 +84,18 @@ namespace OpenRCT2::Ui return static_cast(w); } + virtual void Close(WindowBase& window) = 0; + virtual void CloseSurplus(int32_t cap, WindowClass avoid_classification) = 0; + virtual void CloseByClass(WindowClass cls) = 0; + virtual void CloseByNumber(WindowClass cls, rct_windownumber number) = 0; + virtual void CloseByNumber(WindowClass cls, EntityId number) = 0; + virtual void CloseTop() = 0; + virtual void CloseAll() = 0; + virtual void CloseAllExceptClass(WindowClass cls) = 0; + virtual void CloseAllExceptFlags(uint16_t flags) = 0; + virtual void CloseAllExceptNumberAndClass(rct_windownumber number, WindowClass cls) = 0; + virtual void CloseConstructionWindows() = 0; + virtual WindowBase* FindByClass(WindowClass cls) = 0; virtual WindowBase* FindByNumber(WindowClass cls, rct_windownumber number) = 0; virtual WindowBase* FindByNumber(WindowClass cls, EntityId id) = 0; diff --git a/src/openrct2/world/tile_element/TileElement.cpp b/src/openrct2/world/tile_element/TileElement.cpp index ca9e9fb55ce5..144bb341f34f 100644 --- a/src/openrct2/world/tile_element/TileElement.cpp +++ b/src/openrct2/world/tile_element/TileElement.cpp @@ -11,8 +11,8 @@ #include "../../Diagnostic.h" #include "../../core/Guard.hpp" -#include "../../interface/Window.h" #include "../../interface/WindowClasses.h" +#include "../../ui/WindowManager.h" #include "../Map.h" #include "BannerElement.h" #include "EntranceElement.h" @@ -75,7 +75,8 @@ void TileElement::RemoveBannerEntry() auto banner = GetBanner(bannerIndex); if (banner != nullptr) { - WindowCloseByNumber(WindowClass::Banner, bannerIndex.ToUnderlying()); + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::Banner, bannerIndex.ToUnderlying()); DeleteBanner(banner->id); } } From 81168d57b81500a360e09f176d568b36e2a4f3cf Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Mon, 20 Jan 2025 04:02:19 +0000 Subject: [PATCH 7/8] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-ZZ.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index a0f4bef7de9c..2485a1c87d46 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -3787,4 +3787,6 @@ STR_6723 :Almenaŭ unu animacio-objekto de amuzisto elektendas STR_6724 :Scenaro-Tekstoj STR_6725 :X: STR_6726 :Y: +STR_6727 :Plonĝlopo (maldekstre) +STR_6728 :Plonĝlopo (dekstre) STR_6729 :Kablolifto-monteto devas komenci tuj post stacio aŭ bremso de blokparto From 5bec62c540b8bea53452cf2ccf33c29711f8d49b Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 20 Jan 2025 06:26:31 -0800 Subject: [PATCH 8/8] Beautify TrackData.cpp --- src/openrct2/ride/TrackData.cpp | 906 ++++++++++++++++---------------- 1 file changed, 457 insertions(+), 449 deletions(-) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 70c36a5550d6..c9dcc0139c56 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -1090,192 +1090,192 @@ namespace OpenRCT2::TrackMetaData static_assert(std::size(gTrackCurveChain) == EnumValue(TrackElemType::Count)); const TrackDescriptor gTrackDescriptors[186] = { - { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagDown60 }, - { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagDown60ToDown25 }, - { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagDown60ToFlat }, - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagDown25ToDown60 }, - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagDown25 }, - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBank }, - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagDown25ToFlat }, - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagDown25ToRightBank }, - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonal }, - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankToDown25 }, - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBank }, - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankToFlat }, - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankToUp25 }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::None, TrackElemType::LeftEighthToOrthogonal }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagFlatToDown60 }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagFlatToDown25 }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagFlatToLeftBank }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagFlat }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagFlatToRightBank }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagFlatToUp25 }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagFlatToUp60 }, - { true, TrackPitch::None, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::None, TrackElemType::RightEighthToOrthogonal }, - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankToDown25 }, - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankToFlat }, - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBank }, - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankToUp25 }, - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonal }, - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBank }, - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagUp25ToFlat }, - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagUp25ToRightBank }, - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagUp25 }, - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagUp25ToUp60 }, - { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagUp60ToFlat }, - { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagUp60ToUp25 }, - { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagUp60 }, - { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down90, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileDown90 }, - { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::None, TrackPitch::Down90, TrackRoll::None, TrackElemType::Down90 }, - { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down90ToDown60 }, - { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down90, TrackRoll::None, TrackElemType::RightQuarterTurn1TileDown90 }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down60, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileDown60 }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down90, TrackRoll::None, TrackElemType::Down60ToDown90 }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down60 }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::Down60ToDown25 }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Down60ToFlat }, - { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down60, TrackRoll::None, TrackElemType::RightQuarterTurn1TileDown60 }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3TileDown25 }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::Left, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn5TileDown25 }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::Down25LeftBanked }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftBankedDown25ToDown25 }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedDown25ToLeftBankedFlat }, - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankedDown25ToFlat }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftQuarterTurn3TilesDown25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftQuarterTurn3TilesDown25ToLeftBank }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::Left, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftQuarterTurn5TilesDown25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down25ToDown60 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::Down25ToLeftBankedDown25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::Down25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::Down25ToRightBankedDown25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::Down25ToLeftBank }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Down25ToFlat }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::Down25ToRightBank }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::Right, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightQuarterTurn5TilesDown25 }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::Right, TrackElemType::RightQuarterTurn3TilesDown25ToRightBank }, - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightQuarterTurn3TilesDown25 }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightBankedDown25ToDown25 }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::Down25RightBanked }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankedDown25ToFlat }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedDown25ToRightBankedFlat }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::Right, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn5TileDown25 }, - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3TileDown25 }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3Tiles }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankToLeftQuarterTurn3TilesUp25 }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::Left, TrackPitch::None, TrackRoll::Left, TrackElemType::BankedLeftQuarterTurn5Tiles }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftEighthBankToDiag }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedFlatToLeftBankedDown25 }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftBankToDown25 }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBank }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankToFlat }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedFlatToLeftBankedUp25 }, - { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankToUp25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn3Tiles }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::Left, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn5Tiles }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::None, TrackElemType::LeftEighthToDiag }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::FlatToDown60 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::FlatToLeftBankedDown25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::FlatToDown25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::FlatToRightBankedDown25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::FlatToLeftBank }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Flat }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftVerySmall, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn1Tile }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightVerySmall, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn1Tile }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::FlatToRightBank }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::FlatToLeftBankedUp25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::FlatToUp25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::FlatToRightBankedUp25 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::FlatToUp60 }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::None, TrackElemType::RightEighthToDiag }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::Right, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn5Tiles }, - { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn3Tiles }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightBankToDown25 }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedFlatToRightBankedDown25 }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankToFlat }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBank }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankToUp25 }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedFlatToRightBankedUp25 }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::Right, TrackElemType::RightEighthBankToDiag }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::Right, TrackPitch::None, TrackRoll::Right, TrackElemType::BankedRightQuarterTurn5Tiles }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3Tiles }, - { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankToRightQuarterTurn3TilesUp25 }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3TileUp25 }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::Left, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn5TileUp25 }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedUp25ToLeftBankedFlat }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankedUp25ToFlat }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::Up25LeftBanked }, - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankedUp25ToUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftQuarterTurn3TilesUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::Left, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftQuarterTurn5TilesUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::Up25ToLeftBank }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Up25ToFlat }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::Up25ToRightBank }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::Up25ToLeftBankedUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::Up25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::Up25ToRightBankedUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up25ToUp60 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::Right, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightQuarterTurn5TilesUp25 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightQuarterTurn3TilesUp25 }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankedUp25ToFlat }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedUp25ToRightBankedFlat }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankedUp25ToUp25 }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::Up25RightBanked }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::Right, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn5TileUp25 }, - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3TileUp25 }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up60, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileUp60 }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Up60ToFlat }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::Up60ToUp25 }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up60 }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up90, TrackRoll::None, TrackElemType::Up60ToUp90 }, - { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up60, TrackRoll::None, TrackElemType::RightQuarterTurn1TileUp60 }, - { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up90, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileUp90 }, - { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up90ToUp60 }, - { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up90, TrackRoll::None, TrackElemType::Up90 }, - { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up90, TrackRoll::None, TrackElemType::RightQuarterTurn1TileUp90 }, - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToDiagUp25 }, // TrackElemType::LeftEighthToDiagUp25 - { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToDiagUp25 }, // TrackElemType::RightEighthToDiagUp25 - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToDiagDown25 }, // TrackElemType::LeftEighthToDiagDown25 - { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToDiagDown25 }, // TrackElemType::RightEighthToDiagDown25 - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalUp25 }, // TrackElemType::LeftEighthToOrthogonalUp25 - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalUp25 }, // TrackElemType::RightEighthToOrthogonalUp25 - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalDown25 }, // TrackElemType::LeftEighthToOrthogonalDown25 - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalDown25 }, // TrackElemType::RightEighthToOrthogonalDown25 - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBankedUp25 }, // TrackElemType::DiagUp25ToLeftBankedUp25 - { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25ToRightBankedUp25 }, // TrackElemType::DiagUp25ToRightBankedUp25 - { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToUp25 }, // TrackElemType::DiagLeftBankedUp25ToUp25 - { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToUp25 }, // TrackElemType::DiagRightBankedUp25ToUp25 - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBankedDown25 }, // TrackElemType::DiagDown25ToLeftBankedDown25 - { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25ToRightBankedDown25 }, // TrackElemType::DiagDown25ToRightBankedDown25 - { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToDown25 }, // TrackElemType::DiagLeftBankedDown25ToDown25 - { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToDown25 }, // TrackElemType::DiagRightBankedDown25ToDown25 - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 }, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedUp25 }, // TrackElemType::DiagRightBankedFlatToRightBankedUp25 - { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat }, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat - { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedUp25ToRightBankedFlat }, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat - { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 }, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 - { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedDown25 }, // TrackElemType::DiagRightBankedFlatToRightBankedDown25 - { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat }, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat - { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedDown25ToRightBankedFlat }, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedUp25 }, // TrackElemType::DiagFlatToLeftBankedUp25 - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedUp25 }, // TrackElemType::DiagFlatToRightBankedUp25 - { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToFlat }, // TrackElemType::DiagLeftBankedUp25ToFlat - { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToFlat }, // TrackElemType::DiagRightBankedUp25ToFlat - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedDown25 }, // TrackElemType::DiagFlatToLeftBankedDown25 - { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedDown25 }, // TrackElemType::DiagFlatToRightBankedDown25 - { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToFlat }, // TrackElemType::DiagLeftBankedDown25ToFlat - { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToFlat }, // TrackElemType::DiagRightBankedDown25ToFlat - { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25LeftBanked }, // TrackElemType::Up25LeftBanked - { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25RightBanked }, // TrackElemType::Up25RightBanked - { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25LeftBanked }, // TrackElemType::Down25LeftBanked - { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25RightBanked }, // TrackElemType::Down25RightBanked - { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagUp25 }, // TrackElemType::LeftEighthBankToDiagUp25 - { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagUp25 }, // TrackElemType::RightEighthBankToDiagUp25 - { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagDown25 }, // TrackElemType::LeftEighthBankToDiagDown25 - { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagDown25 }, // TrackElemType::RightEighthBankToDiagDown25 - { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalUp25 }, // TrackElemType::LeftEighthBankToOrthogonalUp25 - { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalUp25 }, // TrackElemType::RightEighthBankToOrthogonalUp25 - { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalDown25 }, // TrackElemType::LeftEighthBankToOrthogonalDown25 - { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalDown25 }, // TrackElemType::RightEighthBankToOrthogonalDown25 + { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagDown60 }, + { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagDown60ToDown25 }, + { true, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagDown60ToFlat }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagDown25ToDown60 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagDown25 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBank }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagDown25ToFlat }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagDown25ToRightBank }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonal }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankToDown25 }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBank }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankToFlat }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankToUp25 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::None, TrackElemType::LeftEighthToOrthogonal }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::DiagFlatToDown60 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagFlatToDown25 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagFlatToLeftBank }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagFlat }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagFlatToRightBank }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagFlatToUp25 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagFlatToUp60 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::None, TrackElemType::RightEighthToOrthogonal }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankToDown25 }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankToFlat }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBank }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankToUp25 }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonal }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBank }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagUp25ToFlat }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagUp25ToRightBank }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagUp25 }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagUp25ToUp60 }, + { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagUp60ToFlat }, + { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagUp60ToUp25 }, + { true, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::DiagUp60 }, + { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down90, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileDown90 }, + { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::None, TrackPitch::Down90, TrackRoll::None, TrackElemType::Down90 }, + { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down90ToDown60 }, + { false, TrackPitch::Down90, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down90, TrackRoll::None, TrackElemType::RightQuarterTurn1TileDown90 }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down60, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileDown60 }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down90, TrackRoll::None, TrackElemType::Down60ToDown90 }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down60 }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::Down60ToDown25 }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Down60ToFlat }, + { false, TrackPitch::Down60, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down60, TrackRoll::None, TrackElemType::RightQuarterTurn1TileDown60 }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3TileDown25 }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::Left, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn5TileDown25 }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::Down25LeftBanked }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftBankedDown25ToDown25 }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedDown25ToLeftBankedFlat }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankedDown25ToFlat }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftQuarterTurn3TilesDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftQuarterTurn3TilesDown25ToLeftBank }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::Left, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftQuarterTurn5TilesDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::Down25ToDown60 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::Down25ToLeftBankedDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::Down25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::Down25ToRightBankedDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::Down25ToLeftBank }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Down25ToFlat }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::Down25ToRightBank }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::Right, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightQuarterTurn5TilesDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::Right, TrackElemType::RightQuarterTurn3TilesDown25ToRightBank }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightQuarterTurn3TilesDown25 }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightBankedDown25ToDown25 }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::Down25RightBanked }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankedDown25ToFlat }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedDown25ToRightBankedFlat }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::Right, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn5TileDown25 }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3TileDown25 }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3Tiles }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankToLeftQuarterTurn3TilesUp25 }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::Left, TrackPitch::None, TrackRoll::Left, TrackElemType::BankedLeftQuarterTurn5Tiles }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftEighthBankToDiag }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftBankedFlatToLeftBankedDown25 }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftBankToDown25 }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBank }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankToFlat }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedFlatToLeftBankedUp25 }, + { false, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankToUp25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn3Tiles }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::Left, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn5Tiles }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::None, TrackRoll::None, TrackElemType::LeftEighthToDiag }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down60, TrackRoll::None, TrackElemType::FlatToDown60 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::FlatToLeftBankedDown25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::FlatToDown25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::FlatToRightBankedDown25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::FlatToLeftBank }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Flat }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::LeftVerySmall, TrackPitch::None, TrackRoll::None, TrackElemType::LeftQuarterTurn1Tile }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightVerySmall, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn1Tile }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::FlatToRightBank }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::FlatToLeftBankedUp25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::FlatToUp25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::FlatToRightBankedUp25 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::FlatToUp60 }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::None, TrackElemType::RightEighthToDiag }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::Right, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn5Tiles }, + { false, TrackPitch::None, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::None, TrackElemType::RightQuarterTurn3Tiles }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightBankToDown25 }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightBankedFlatToRightBankedDown25 }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankToFlat }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBank }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankToUp25 }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedFlatToRightBankedUp25 }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::None, TrackRoll::Right, TrackElemType::RightEighthBankToDiag }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::Right, TrackPitch::None, TrackRoll::Right, TrackElemType::BankedRightQuarterTurn5Tiles }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3Tiles }, + { false, TrackPitch::None, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankToRightQuarterTurn3TilesUp25 }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn3TileUp25 }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::Left, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftBankedQuarterTurn5TileUp25 }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::LeftBankedUp25ToLeftBankedFlat }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::LeftBankedUp25ToFlat }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::Up25LeftBanked }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftBankedUp25ToUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftQuarterTurn3TilesUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::Left, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftQuarterTurn5TilesUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::Up25ToLeftBank }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Up25ToFlat }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::Up25ToRightBank }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::Up25ToLeftBankedUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::Up25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::Up25ToRightBankedUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up25ToUp60 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::Right, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightQuarterTurn5TilesUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightQuarterTurn3TilesUp25 }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::RightBankedUp25ToFlat }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::RightBankedUp25ToRightBankedFlat }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightBankedUp25ToUp25 }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::Up25RightBanked }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::Right, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn5TileUp25 }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightSmall, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightBankedQuarterTurn3TileUp25 }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up60, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileUp60 }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::Up60ToFlat }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::Up60ToUp25 }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up60 }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::None, TrackPitch::Up90, TrackRoll::None, TrackElemType::Up60ToUp90 }, + { false, TrackPitch::Up60, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up60, TrackRoll::None, TrackElemType::RightQuarterTurn1TileUp60 }, + { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::LeftSmall, TrackPitch::Up90, TrackRoll::None, TrackElemType::LeftQuarterTurn1TileUp90 }, + { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up90ToUp60 }, + { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up90, TrackRoll::None, TrackElemType::Up90 }, + { false, TrackPitch::Up90, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up90, TrackRoll::None, TrackElemType::RightQuarterTurn1TileUp90 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToDiagUp25 }, + { false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToDiagUp25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToDiagDown25 }, + { false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToDiagDown25 }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalUp25 }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalUp25 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalDown25 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalDown25 }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBankedUp25 }, + { true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25ToRightBankedUp25 }, + { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToUp25 }, + { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToUp25 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBankedDown25 }, + { true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25ToRightBankedDown25 }, + { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToDown25 }, + { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToDown25 }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedUp25 }, + { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat }, + { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedUp25ToRightBankedFlat }, + { true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 }, + { true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedDown25 }, + { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat }, + { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedDown25ToRightBankedFlat }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedUp25 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedUp25 }, + { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToFlat }, + { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToFlat }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedDown25 }, + { true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedDown25 }, + { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToFlat }, + { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToFlat }, + { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25LeftBanked }, + { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25RightBanked }, + { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25LeftBanked }, + { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25RightBanked }, + { false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagUp25 }, + { false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagUp25 }, + { false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagDown25 }, + { false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagDown25 }, + { true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalUp25 }, + { true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalUp25 }, + { true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalDown25 }, + { true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalDown25 }, }; /** rct2: 0x00993D1C */ @@ -3057,263 +3057,263 @@ namespace OpenRCT2::TrackMetaData static constexpr TrackDefinition TrackDefinitions[] = { // TYPE VANGLE END VANGLE START BANK END BANK START PREVIEW Z OFFSET - { TrackGroup::straight, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Flat - { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::EndStation - { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BeginStation - { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MiddleStation - { TrackGroup::slope, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25 - { TrackGroup::slopeSteepUp, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60 - { TrackGroup::slope, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp25 - { TrackGroup::slopeSteepUp, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToUp60 - { TrackGroup::slopeSteepUp, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp25 - { TrackGroup::slope, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToFlat - { TrackGroup::slope, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25 - { TrackGroup::slopeSteepDown, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60 - { TrackGroup::slope, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown25 - { TrackGroup::slopeSteepDown, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToDown60 - { TrackGroup::slopeSteepDown, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown25 - { TrackGroup::slope, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToFlat - { TrackGroup::curve, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5Tiles - { TrackGroup::curve, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5Tiles - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToFlat - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToFlat - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::BankedLeftQuarterTurn5Tiles - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::BankedRightQuarterTurn5Tiles - { TrackGroup::flatRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToUp25 - { TrackGroup::flatRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToUp25 - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Up25ToLeftBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Up25ToRightBank - { TrackGroup::flatRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToDown25 - { TrackGroup::flatRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToDown25 - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Down25ToLeftBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Down25ToRightBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBank - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBank - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesUp25 - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesUp25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesDown25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesDown25 - { TrackGroup::sBend, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendLeft - { TrackGroup::sBend, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendRight - { TrackGroup::verticalLoop, TrackPitch::Down25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, -48 }, // TrackElemType::LeftVerticalLoop - { TrackGroup::verticalLoop, TrackPitch::Down25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, -48 }, // TrackElemType::RightVerticalLoop - { TrackGroup::curveSmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3Tiles - { TrackGroup::curveSmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3Tiles - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3Tiles - { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3Tiles - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesUp25 - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesUp25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesDown25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesDown25 - { TrackGroup::curveVerySmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1Tile - { TrackGroup::curveVerySmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1Tile - { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftTwistDownToUp - { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightTwistDownToUp - { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::LeftTwistUpToDown - { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::RightTwistUpToDown - { TrackGroup::halfLoop, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::HalfLoopUp - { TrackGroup::halfLoop, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::HalfLoopDown - { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftCorkscrewUp - { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightCorkscrewUp - { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -32 }, // TrackElemType::LeftCorkscrewDown - { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -32 }, // TrackElemType::RightCorkscrewDown - { TrackGroup::flatToSteepSlope, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp60 - { TrackGroup::flatToSteepSlope, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToFlat - { TrackGroup::flatToSteepSlope, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown60 - { TrackGroup::flatToSteepSlope, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToFlat - { TrackGroup::tower, TrackPitch::Tower, TrackPitch::Tower, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::TowerBase - { TrackGroup::tower, TrackPitch::Tower, TrackPitch::Tower, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::TowerSection - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatCovered - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25Covered - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60Covered - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp25Covered - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToUp60Covered - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp25Covered - { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToFlatCovered - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25Covered - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60Covered - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown25Covered - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToDown60Covered - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown25Covered - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToFlatCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendLeftCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendRightCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesCovered - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesCovered - { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixUpSmall - { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixUpSmall - { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixDownSmall - { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixDownSmall - { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixUpLarge - { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixUpLarge - { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixDownLarge - { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixDownLarge - { TrackGroup::slopeCurveSteep, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileUp60 - { TrackGroup::slopeCurveSteep, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileUp60 - { TrackGroup::slopeCurveSteep, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileDown60 - { TrackGroup::slopeCurveSteep, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileDown60 - { TrackGroup::brakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Brakes - { TrackGroup::booster, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Booster - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::InvertedUp90ToFlatQuarterLoopAlias / Maze - { TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeUp - { TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightQuarterBankedHelixLargeUp - { TrackGroup::helixDownBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeDown - { TrackGroup::helixDownBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightQuarterBankedHelixLargeDown - { TrackGroup::helixUpUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterHelixLargeUp - { TrackGroup::helixUpUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterHelixLargeUp - { TrackGroup::helixDownUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterHelixLargeDown - { TrackGroup::helixDownUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterHelixLargeDown - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::Up25LeftBanked - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::Up25RightBanked - { TrackGroup::waterfall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Waterfall - { TrackGroup::rapids, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Rapids - { TrackGroup::onridePhoto, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::OnRidePhoto - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::Down25LeftBanked - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::Down25RightBanked - { TrackGroup::waterSplash, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Watersplash - { TrackGroup::slopeSteepLong, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp60LongBase - { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToFlatLongBase - { TrackGroup::whirlpool, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Whirlpool - { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToFlatLongBase - { TrackGroup::slopeSteepLong, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown60LongBase - { TrackGroup::liftHillCable, TrackPitch::Down60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::CableLiftHill - { TrackGroup::reverseFreefall, TrackPitch::ReverseFreefall, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::ReverseFreefallSlope - { TrackGroup::reverseFreefall, TrackPitch::ReverseFreefall, TrackPitch::ReverseFreefall,TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::ReverseFreefallVertical - { TrackGroup::flat, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up90 - { TrackGroup::flat, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down90 - { TrackGroup::flat, TrackPitch::Up90, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp90 - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down90ToDown60 - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up90ToUp60 - { TrackGroup::flat, TrackPitch::Down90, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown90 - { TrackGroup::brakeForDrop, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BrakeForDrop - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftEighthToDiag - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightEighthToDiag - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftEighthToOrthogonal - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightEighthToOrthogonal - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftEighthBankToDiag - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightEighthBankToDiag - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftEighthBankToOrthogonal - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightEighthBankToOrthogonal - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlat - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25 - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60 - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToUp25 - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToUp60 - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60ToUp25 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToFlat - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25 - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60 - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToDown25 - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToDown60 - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60ToDown25 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToFlat - { TrackGroup::flat, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToUp60 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60ToFlat - { TrackGroup::flat, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToDown60 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60ToFlat - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToLeftBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToRightBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToFlat - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToFlat - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToUp25 - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToUp25 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToLeftBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToRightBank - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToDown25 - { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToDown25 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToLeftBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToRightBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBank - { TrackGroup::logFlumeReverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LogFlumeReverser - { TrackGroup::spinningTunnel, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SpinningTunnel - { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftBarrelRollUpToDown - { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightBarrelRollUpToDown - { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::LeftBarrelRollDownToUp - { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::RightBarrelRollDownToUp - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToLeftQuarterTurn3TilesUp25 - { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToRightQuarterTurn3TilesUp25 - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesDown25ToLeftBank - { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesDown25ToRightBank - { TrackGroup::poweredLift, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::PoweredLift - {TrackGroup::halfLoopLarge, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::LeftLargeHalfLoopUp - {TrackGroup::halfLoopLarge, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::RightLargeHalfLoopUp - {TrackGroup::halfLoopLarge, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::LeftLargeHalfLoopDown - {TrackGroup::halfLoopLarge, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::RightLargeHalfLoopDown - {TrackGroup::inlineTwistUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerTwistUp - {TrackGroup::inlineTwistUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerTwistUp - {TrackGroup::inlineTwistInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerTwistDown - {TrackGroup::inlineTwistInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerTwistDown - {TrackGroup::flyingHalfLoopUninvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::FlyerHalfLoopUninvertedUp - {TrackGroup::flyingHalfLoopInvertedDown, TrackPitch::Down25, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -64 }, // TrackElemType::FlyerHalfLoopInvertedDown - {TrackGroup::corkscrewUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerCorkscrewUp - {TrackGroup::corkscrewUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerCorkscrewUp - {TrackGroup::corkscrewInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -32 }, // TrackElemType::LeftFlyerCorkscrewDown - {TrackGroup::corkscrewInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -32 }, // TrackElemType::RightFlyerCorkscrewDown - {TrackGroup::heartlineTransfer, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::HeartLineTransferUp - {TrackGroup::heartlineTransfer, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::HeartLineTransferDown - {TrackGroup::heartlineRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftHeartLineRoll - {TrackGroup::heartlineRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightHeartLineRoll - {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleA - {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleB - {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleC - {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleD - {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleE - { TrackGroup::quarterLoopInvertedDown, TrackPitch::Down90, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop - { TrackGroup::quarterLoop, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::Up90ToInvertedFlatQuarterLoop - { TrackGroup::quarterLoop, TrackPitch::Down90, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::InvertedFlatToDown90QuarterLoop - { TrackGroup::liftHillCurved, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftCurvedLiftHill - { TrackGroup::liftHillCurved, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightCurvedLiftHill - { TrackGroup::reverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftReverser - { TrackGroup::reverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightReverser - { TrackGroup::slopeToFlat, TrackPitch::Down90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustTopCap - { TrackGroup::slopeToFlat, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustVerticalDown - { TrackGroup::slopeToFlat, TrackPitch::None, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustVerticalDownToLevel - { TrackGroup::blockBrakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BlockBrakes - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3TileUp25 - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3TileUp25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3TileDown25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3TileDown25 - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn5TileUp25 - { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn5TileUp25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn5TileDown25 - { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn5TileDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Up25ToLeftBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Up25ToRightBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Down25ToLeftBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Down25ToRightBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedFlatToLeftBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedFlatToRightBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToLeftBankedFlat - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToRightBankedFlat - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedFlatToLeftBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedFlatToRightBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToLeftBankedFlat - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToRightBankedFlat - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBankedUp25 - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToFlat - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToFlat - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBankedDown25 - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToFlat - { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToFlat - { TrackGroup::slopeCurveSteep, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileUp90 - { TrackGroup::slopeCurveSteep, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileUp90 - { TrackGroup::slopeCurveSteep, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileDown90 - { TrackGroup::slopeCurveSteep, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileDown90 - { TrackGroup::quarterLoopUninvertedUp, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop - { TrackGroup::quarterLoopUninvertedDown, TrackPitch::Down90, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimFlatToDown90QuarterLoop - { TrackGroup::quarterLoopInvertedUp, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop - { TrackGroup::rotationControlToggle, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RotationControlToggle + { TrackGroup::straight, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Flat + { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::EndStation + { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BeginStation + { TrackGroup::stationEnd, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MiddleStation + { TrackGroup::slope, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25 + { TrackGroup::slopeSteepUp, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60 + { TrackGroup::slope, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp25 + { TrackGroup::slopeSteepUp, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToUp60 + { TrackGroup::slopeSteepUp, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp25 + { TrackGroup::slope, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToFlat + { TrackGroup::slope, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25 + { TrackGroup::slopeSteepDown, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60 + { TrackGroup::slope, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown25 + { TrackGroup::slopeSteepDown, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToDown60 + { TrackGroup::slopeSteepDown, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown25 + { TrackGroup::slope, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToFlat + { TrackGroup::curve, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5Tiles + { TrackGroup::curve, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5Tiles + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToFlat + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToFlat + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::BankedLeftQuarterTurn5Tiles + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::BankedRightQuarterTurn5Tiles + { TrackGroup::flatRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToUp25 + { TrackGroup::flatRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToUp25 + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Up25ToLeftBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Up25ToRightBank + { TrackGroup::flatRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToDown25 + { TrackGroup::flatRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToDown25 + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Down25ToLeftBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Down25ToRightBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBank + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBank + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesUp25 + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesUp25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesDown25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesDown25 + { TrackGroup::sBend, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendLeft + { TrackGroup::sBend, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendRight + { TrackGroup::verticalLoop, TrackPitch::Down25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, -48 }, // TrackElemType::LeftVerticalLoop + { TrackGroup::verticalLoop, TrackPitch::Down25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, -48 }, // TrackElemType::RightVerticalLoop + { TrackGroup::curveSmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3Tiles + { TrackGroup::curveSmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3Tiles + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3Tiles + { TrackGroup::flatRollBanking, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3Tiles + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesUp25 + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesUp25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesDown25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesDown25 + { TrackGroup::curveVerySmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1Tile + { TrackGroup::curveVerySmall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1Tile + { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftTwistDownToUp + { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightTwistDownToUp + { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::LeftTwistUpToDown + { TrackGroup::twist, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::RightTwistUpToDown + { TrackGroup::halfLoop, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::HalfLoopUp + { TrackGroup::halfLoop, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::HalfLoopDown + { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftCorkscrewUp + { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightCorkscrewUp + { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -32 }, // TrackElemType::LeftCorkscrewDown + { TrackGroup::corkscrew, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -32 }, // TrackElemType::RightCorkscrewDown + { TrackGroup::flatToSteepSlope, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp60 + { TrackGroup::flatToSteepSlope, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToFlat + { TrackGroup::flatToSteepSlope, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown60 + { TrackGroup::flatToSteepSlope, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToFlat + { TrackGroup::tower, TrackPitch::Tower, TrackPitch::Tower, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::TowerBase + { TrackGroup::tower, TrackPitch::Tower, TrackPitch::Tower, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::TowerSection + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatCovered + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25Covered + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60Covered + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp25Covered + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToUp60Covered + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp25Covered + { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up25ToFlatCovered + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25Covered + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60Covered + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown25Covered + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToDown60Covered + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown25Covered + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25ToFlatCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn5TilesCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn5TilesCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendLeftCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SBendRightCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesCovered + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesCovered + { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixUpSmall + { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixUpSmall + { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixDownSmall + { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixDownSmall + { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixUpLarge + { TrackGroup::helixUpBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixUpLarge + { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftHalfBankedHelixDownLarge + { TrackGroup::helixDownBankedHalf, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightHalfBankedHelixDownLarge + { TrackGroup::slopeCurveSteep, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileUp60 + { TrackGroup::slopeCurveSteep, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileUp60 + { TrackGroup::slopeCurveSteep, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileDown60 + { TrackGroup::slopeCurveSteep, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileDown60 + { TrackGroup::brakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Brakes + { TrackGroup::booster, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Booster + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Maze + { TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeUp + { TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightQuarterBankedHelixLargeUp + { TrackGroup::helixDownBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeDown + { TrackGroup::helixDownBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightQuarterBankedHelixLargeDown + { TrackGroup::helixUpUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterHelixLargeUp + { TrackGroup::helixUpUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterHelixLargeUp + { TrackGroup::helixDownUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterHelixLargeDown + { TrackGroup::helixDownUnbankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterHelixLargeDown + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::Up25LeftBanked + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::Up25RightBanked + { TrackGroup::waterfall, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Waterfall + { TrackGroup::rapids, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Rapids + { TrackGroup::onridePhoto, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::OnRidePhoto + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::Down25LeftBanked + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::Down25RightBanked + { TrackGroup::waterSplash, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Watersplash + { TrackGroup::slopeSteepLong, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToUp60LongBase + { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToFlatLongBase + { TrackGroup::whirlpool, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Whirlpool + { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToFlatLongBase + { TrackGroup::slopeSteepLong, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatToDown60LongBase + { TrackGroup::liftHillCable, TrackPitch::Down60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::CableLiftHill + { TrackGroup::reverseFreefall, TrackPitch::ReverseFreefall, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::ReverseFreefallSlope + { TrackGroup::reverseFreefall, TrackPitch::ReverseFreefall, TrackPitch::ReverseFreefall,TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::ReverseFreefallVertical + { TrackGroup::flat, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up90 + { TrackGroup::flat, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down90 + { TrackGroup::flat, TrackPitch::Up90, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up60ToUp90 + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down90ToDown60 + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Up90ToUp60 + { TrackGroup::flat, TrackPitch::Down90, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down60ToDown90 + { TrackGroup::brakeForDrop, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BrakeForDrop + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftEighthToDiag + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightEighthToDiag + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftEighthToOrthogonal + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightEighthToOrthogonal + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftEighthBankToDiag + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightEighthBankToDiag + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftEighthBankToOrthogonal + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightEighthBankToOrthogonal + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlat + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25 + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60 + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToUp25 + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToUp60 + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60ToUp25 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToFlat + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25 + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60 + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToDown25 + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToDown60 + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60ToDown25 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToFlat + { TrackGroup::flat, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToUp60 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagUp60ToFlat + { TrackGroup::flat, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToDown60 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagDown60ToFlat + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToLeftBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagFlatToRightBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToFlat + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToFlat + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToUp25 + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToUp25 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToLeftBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagUp25ToRightBank + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBankToDown25 + { TrackGroup::flat, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBankToDown25 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToLeftBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::DiagDown25ToRightBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::DiagLeftBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::DiagRightBank + { TrackGroup::logFlumeReverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LogFlumeReverser + { TrackGroup::spinningTunnel, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::SpinningTunnel + { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftBarrelRollUpToDown + { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightBarrelRollUpToDown + { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::LeftBarrelRollDownToUp + { TrackGroup::barrelRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::RightBarrelRollDownToUp + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankToLeftQuarterTurn3TilesUp25 + { TrackGroup::flat, TrackPitch::Up25, TrackPitch::None, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankToRightQuarterTurn3TilesUp25 + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn3TilesDown25ToLeftBank + { TrackGroup::flat, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn3TilesDown25ToRightBank + { TrackGroup::poweredLift, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::PoweredLift + {TrackGroup::halfLoopLarge, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::LeftLargeHalfLoopUp + {TrackGroup::halfLoopLarge, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::RightLargeHalfLoopUp + {TrackGroup::halfLoopLarge, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::LeftLargeHalfLoopDown + {TrackGroup::halfLoopLarge, TrackPitch::Down25, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::RightLargeHalfLoopDown + {TrackGroup::inlineTwistUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerTwistUp + {TrackGroup::inlineTwistUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerTwistUp + {TrackGroup::inlineTwistInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerTwistDown + {TrackGroup::inlineTwistInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerTwistDown + {TrackGroup::flyingHalfLoopUninvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::FlyerHalfLoopUninvertedUp + {TrackGroup::flyingHalfLoopInvertedDown, TrackPitch::Down25, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -64 }, // TrackElemType::FlyerHalfLoopInvertedDown + {TrackGroup::corkscrewUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::LeftFlyerCorkscrewUp + {TrackGroup::corkscrewUninverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::RightFlyerCorkscrewUp + {TrackGroup::corkscrewInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -32 }, // TrackElemType::LeftFlyerCorkscrewDown + {TrackGroup::corkscrewInverted, TrackPitch::None, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -32 }, // TrackElemType::RightFlyerCorkscrewDown + {TrackGroup::heartlineTransfer, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::HeartLineTransferUp + {TrackGroup::heartlineTransfer, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::HeartLineTransferDown + {TrackGroup::heartlineRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftHeartLineRoll + {TrackGroup::heartlineRoll, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightHeartLineRoll + {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleA + {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleB + {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleC + {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleD + {TrackGroup::miniGolfHole, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::MinigolfHoleE + { TrackGroup::quarterLoopInvertedDown, TrackPitch::Down90, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop + { TrackGroup::quarterLoop, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::Up90ToInvertedFlatQuarterLoop + { TrackGroup::quarterLoop, TrackPitch::Down90, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, 0 }, // TrackElemType::InvertedFlatToDown90QuarterLoop + { TrackGroup::liftHillCurved, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftCurvedLiftHill + { TrackGroup::liftHillCurved, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightCurvedLiftHill + { TrackGroup::reverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftReverser + { TrackGroup::reverser, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightReverser + { TrackGroup::slopeToFlat, TrackPitch::Down90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustTopCap + { TrackGroup::slopeToFlat, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustVerticalDown + { TrackGroup::slopeToFlat, TrackPitch::None, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::AirThrustVerticalDownToLevel + { TrackGroup::blockBrakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::BlockBrakes + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3TileUp25 + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3TileUp25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn3TileDown25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn3TileDown25 + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn5TileUp25 + { TrackGroup::slopeCurve, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn5TileUp25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedQuarterTurn5TileDown25 + { TrackGroup::slopeCurve, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedQuarterTurn5TileDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Up25ToLeftBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Up25ToRightBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::Up25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::Down25ToLeftBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::Down25ToRightBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedFlatToLeftBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedFlatToRightBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToLeftBankedFlat + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToRightBankedFlat + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedFlatToLeftBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedFlatToRightBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToLeftBankedFlat + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToRightBankedFlat + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::Up25, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBankedUp25 + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedUp25ToFlat + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Up25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedUp25ToFlat + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Left, TrackRoll::None, 0 }, // TrackElemType::FlatToLeftBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::Down25, TrackPitch::None, TrackRoll::Right, TrackRoll::None, 0 }, // TrackElemType::FlatToRightBankedDown25 + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::Left, 0 }, // TrackElemType::LeftBankedDown25ToFlat + { TrackGroup::slopeRollBanking, TrackPitch::None, TrackPitch::Down25, TrackRoll::None, TrackRoll::Right, 0 }, // TrackElemType::RightBankedDown25ToFlat + { TrackGroup::slopeCurveSteep, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileUp90 + { TrackGroup::slopeCurveSteep, TrackPitch::Up90, TrackPitch::Up90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileUp90 + { TrackGroup::slopeCurveSteep, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::LeftQuarterTurn1TileDown90 + { TrackGroup::slopeCurveSteep, TrackPitch::Down90, TrackPitch::Down90, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileDown90 + { TrackGroup::quarterLoopUninvertedUp, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop + { TrackGroup::quarterLoopUninvertedDown, TrackPitch::Down90, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimFlatToDown90QuarterLoop + { TrackGroup::quarterLoopInvertedUp, TrackPitch::None, TrackPitch::Up90, TrackRoll::UpsideDown, TrackRoll::None, 0 }, // TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop + { TrackGroup::rotationControlToggle, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RotationControlToggle { TrackGroup::flatRideBase, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatTrack1x4A { TrackGroup::flatRideBase, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatTrack2x2 { TrackGroup::flatRideBase, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::FlatTrack4x4 @@ -3341,8 +3341,8 @@ namespace OpenRCT2::TrackMetaData { TrackGroup::zeroGRollLarge, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::LeftLargeZeroGRollDown { TrackGroup::zeroGRollLarge, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -64 }, // TrackElemType::RightLargeZeroGRollDown { TrackGroup::flyingLargeHalfLoopUninvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp - { TrackGroup::flyingLargeHalfLoopUninvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::RightFlyerLargeHalfLoopUninvertedUp - { TrackGroup::flyingLargeHalfLoopInvertedDown, TrackPitch::Down25, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -64 }, // TrackElemType::LeftFlyerLargeHalfLoopInvertedDown + { TrackGroup::flyingLargeHalfLoopUninvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::RightFlyerLargeHalfLoopUninvertedUp + { TrackGroup::flyingLargeHalfLoopInvertedDown, TrackPitch::Down25, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -64 }, // TrackElemType::LeftFlyerLargeHalfLoopInvertedDown { TrackGroup::flyingLargeHalfLoopInvertedDown, TrackPitch::Down25, TrackPitch::None, TrackRoll::UpsideDown, TrackRoll::None, -64 }, // TrackElemType::RightFlyerLargeHalfLoopInvertedDown { TrackGroup::flyingLargeHalfLoopInvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::LeftFlyerLargeHalfLoopInvertedUp { TrackGroup::flyingLargeHalfLoopInvertedUp, TrackPitch::None, TrackPitch::Up25, TrackRoll::UpsideDown, TrackRoll::None, 64 }, // TrackElemType::RightFlyerLargeHalfLoopInvertedUp @@ -3398,10 +3398,10 @@ namespace OpenRCT2::TrackMetaData { TrackGroup::diagBlockBrakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagBlockBrakes { TrackGroup::inclinedBrakes, TrackPitch::Down25, TrackPitch::Down25, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Down25Brakes { TrackGroup::diagBooster, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::DiagBooster - { TrackGroup::slopeSteepLong, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 16 }, // TrackElemType::DiagFlatToUp60LongBase, - { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 48 }, // TrackElemType::DiagUp60ToFlatLongBase, - { TrackGroup::slopeSteepLong, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, -32 }, // TrackElemType::DiagFlatToDown60LongBase, - { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, -24 }, // TrackElemType::DiagDown60ToFlatLongBase, + { TrackGroup::slopeSteepLong, TrackPitch::Up60, TrackPitch::None, TrackRoll::None, TrackRoll::None, 16 }, // TrackElemType::DiagFlatToUp60LongBase, + { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Up60, TrackRoll::None, TrackRoll::None, 48 }, // TrackElemType::DiagUp60ToFlatLongBase, + { TrackGroup::slopeSteepLong, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::None, -32 }, // TrackElemType::DiagFlatToDown60LongBase, + { TrackGroup::slopeSteepLong, TrackPitch::None, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, -24 }, // TrackElemType::DiagDown60ToFlatLongBase, { TrackGroup::diveLoop, TrackPitch::None, TrackPitch::Up60, TrackRoll::UpsideDown, TrackRoll::None, 56 }, // TrackElemType::LeftEighthDiveLoopUpToOrthogonal { TrackGroup::diveLoop, TrackPitch::None, TrackPitch::Up60, TrackRoll::UpsideDown, TrackRoll::None, 56 }, // TrackElemType::RightEighthDiveLoopUpToOrthogonal { TrackGroup::diveLoop, TrackPitch::Down60, TrackPitch::None, TrackRoll::None, TrackRoll::UpsideDown, -56 }, // TrackElemType::LeftEighthDiveLoopDownToDiag @@ -3474,6 +3474,8 @@ namespace OpenRCT2::TrackMetaData }; static_assert(std::size(TrackTypeToSpinFunction) == EnumValue(TrackElemType::Count)); +#pragma region GForces + template static int32_t EvaluatorConst(const int16_t) { @@ -4478,6 +4480,8 @@ namespace OpenRCT2::TrackMetaData } } +#pragma endregion + static constexpr StringId RideConfigurationStringIds[] = { kStringIdEmpty, // 0 STR_STATION_PLATFORM, // 1 @@ -4831,6 +4835,8 @@ namespace OpenRCT2::TrackMetaData }; static_assert(std::size(RideConfigurationStringIds) == EnumValue(TrackElemType::Count)); +#pragma region trackBlocks + static constexpr SequenceDescriptor kFlatSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, @@ -13045,6 +13051,8 @@ namespace OpenRCT2::TrackMetaData kRightEighthDiveLoopDownToDiagSeq3, kRightEighthDiveLoopDownToDiagSeq4, kRightEighthDiveLoopDownToDiagSeq5 } }, }; +#pragma endregion + static constexpr auto BuildDescriptorTable() { std::array res{};